Auth: Handle when access token has already been refreshed in OAuth token sync (#77118)

* Use singleflight to prevent logging error if the token has already been refreshed

* Change order of error checks

* align tests, change error name

* Change sf key

* Update based on the review

* refactor
This commit is contained in:
Misi
2023-10-25 18:15:41 +02:00
committed by GitHub
parent d2732ae726
commit 1e81ffccac
3 changed files with 56 additions and 26 deletions
+1 -1
View File
@@ -173,7 +173,7 @@ func checkOAuthRefreshToken(authInfo *login.UserAuth) error {
}
if authInfo.OAuthRefreshToken == "" {
logger.Debug("No refresh token available",
logger.Warn("No refresh token available",
"authmodule", authInfo.AuthModule, "userid", authInfo.UserId)
return ErrNoRefreshTokenFound
}