Auth: Return error when retries have been exhausted for OAuth token refresh (#98034)

Return error when retries for DB lock have been exhausted in oauth_token.go
This commit is contained in:
Misi
2024-12-16 17:03:39 +01:00
committed by GitHub
parent b310b6f8c5
commit 6cd3a5458e
3 changed files with 60 additions and 3 deletions

View File

@@ -98,6 +98,11 @@ func (s *OAuthTokenSync) SyncOauthTokenHook(ctx context.Context, id *authn.Ident
return nil, nil
}
if errors.Is(refreshErr, oauthtoken.ErrRetriesExhausted) {
ctxLogger.Warn("Retries have been exhausted for locking the DB for OAuth token refresh", "id", id.ID, "error", refreshErr)
return nil, refreshErr
}
ctxLogger.Error("Failed to refresh OAuth access token", "id", id.ID, "error", refreshErr)
// log the user out