From 30869d0f40cb4300855719068b513b646d26811e Mon Sep 17 00:00:00 2001 From: Avery Pennarun Date: Wed, 5 May 2021 23:16:44 -0400 Subject: [PATCH] controlclient: update Persist.LoginName when it changes. Well, that was anticlimactic. Fixes tailscale/corp#461. Signed-off-by: Avery Pennarun --- control/controlclient/direct.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/control/controlclient/direct.go b/control/controlclient/direct.go index 5e522ed93..3ebc2d29e 100644 --- a/control/controlclient/direct.go +++ b/control/controlclient/direct.go @@ -460,10 +460,10 @@ func (c *Direct) doLogin(ctx context.Context, opt loginOpt) (mustRegen bool, new request.NodeKey.ShortString()) return true, "", nil } - if persist.Provider == "" { + if resp.Login.Provider != "" { persist.Provider = resp.Login.Provider } - if persist.LoginName == "" { + if resp.Login.LoginName != "" { persist.LoginName = resp.Login.LoginName }