Expire device flow info on success (#359)

We should expire the device flow
info soon as we get a token with success.
This commit is contained in:
Maycon Santos 2022-06-09 02:14:31 +02:00 committed by GitHub
parent 57536da245
commit f810feafdf
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -303,6 +303,10 @@ func (s *Server) WaitSSOLogin(callerCtx context.Context, msg *proto.WaitSSOLogin
return nil, err return nil, err
} }
s.mutex.Lock()
s.oauthAuthFlow.expiresAt = time.Now()
s.mutex.Unlock()
if loginStatus, err := s.loginAttempt(ctx, "", tokenInfo.AccessToken); err != nil { if loginStatus, err := s.loginAttempt(ctx, "", tokenInfo.AccessToken); err != nil {
state.Set(loginStatus) state.Set(loginStatus)
return nil, err return nil, err