From f810feafdfefb36c68a59512c4b85d081ce530c6 Mon Sep 17 00:00:00 2001 From: Maycon Santos Date: Thu, 9 Jun 2022 02:14:31 +0200 Subject: [PATCH] Expire device flow info on success (#359) We should expire the device flow info soon as we get a token with success. --- client/server/server.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/client/server/server.go b/client/server/server.go index 18794cb60..8a4ca0ab0 100644 --- a/client/server/server.go +++ b/client/server/server.go @@ -303,6 +303,10 @@ func (s *Server) WaitSSOLogin(callerCtx context.Context, msg *proto.WaitSSOLogin return nil, err } + s.mutex.Lock() + s.oauthAuthFlow.expiresAt = time.Now() + s.mutex.Unlock() + if loginStatus, err := s.loginAttempt(ctx, "", tokenInfo.AccessToken); err != nil { state.Set(loginStatus) return nil, err