diff --git a/control/controlclient/direct.go b/control/controlclient/direct.go index cd8e123d3..0e76ea174 100644 --- a/control/controlclient/direct.go +++ b/control/controlclient/direct.go @@ -6,7 +6,6 @@ import ( "bufio" "bytes" - "cmp" "context" "crypto/ed25519" "encoding/base64" @@ -587,11 +586,9 @@ func (c *Direct) doLogin(ctx context.Context, opt loginOpt) (mustRegen bool, new c.logf("RegisterReq: onode=%v node=%v fup=%v nks=%v", request.OldNodeKey.ShortString(), request.NodeKey.ShortString(), opt.URL != "", len(nodeKeySignature) > 0) - if opt.Token != nil || cmp.Or(persist.Provider, persist.UserProfile.LoginName, authKey) != "" { + if opt.Token != nil || authKey != "" { request.Auth = &tailcfg.RegisterResponseAuth{ Oauth2Token: opt.Token, - Provider: persist.Provider, - LoginName: persist.UserProfile.LoginName, AuthKey: authKey, } } diff --git a/tailcfg/tailcfg.go b/tailcfg/tailcfg.go index 6121f90dc..565c97799 100644 --- a/tailcfg/tailcfg.go +++ b/tailcfg/tailcfg.go @@ -1070,10 +1070,8 @@ func (st SignatureType) String() string { type RegisterResponseAuth struct { _ structs.Incomparable - // One of Provider/LoginName, Oauth2Token, or AuthKey is set. + // At most one of Oauth2Token or AuthKey is set. - Provider string `json:",omitempty"` - LoginName string `json:",omitempty"` Oauth2Token *Oauth2Token `json:",omitempty"` AuthKey string `json:",omitempty"` } diff --git a/tailcfg/tailcfg_clone.go b/tailcfg/tailcfg_clone.go index 26ea72f70..f31100a11 100644 --- a/tailcfg/tailcfg_clone.go +++ b/tailcfg/tailcfg_clone.go @@ -321,8 +321,6 @@ func (src *RegisterResponseAuth) Clone() *RegisterResponseAuth { // A compilation failure here means this code must be regenerated, with the command at the top of this file. var _RegisterResponseAuthCloneNeedsRegeneration = RegisterResponseAuth(struct { _ structs.Incomparable - Provider string - LoginName string Oauth2Token *Oauth2Token AuthKey string }{}) diff --git a/tailcfg/tailcfg_view.go b/tailcfg/tailcfg_view.go index ea90bab6d..052f581e6 100644 --- a/tailcfg/tailcfg_view.go +++ b/tailcfg/tailcfg_view.go @@ -701,8 +701,6 @@ func (v *RegisterResponseAuthView) UnmarshalJSON(b []byte) error { return nil } -func (v RegisterResponseAuthView) Provider() string { return v.ж.Provider } -func (v RegisterResponseAuthView) LoginName() string { return v.ж.LoginName } func (v RegisterResponseAuthView) Oauth2Token() *Oauth2Token { if v.ж.Oauth2Token == nil { return nil @@ -716,8 +714,6 @@ func (v RegisterResponseAuthView) AuthKey() string { return v.ж.AuthKey } // A compilation failure here means this code must be regenerated, with the command at the top of this file. var _RegisterResponseAuthViewNeedsRegeneration = RegisterResponseAuth(struct { _ structs.Incomparable - Provider string - LoginName string Oauth2Token *Oauth2Token AuthKey string }{})