Suppress `ExternalLoginUserNotExist` error (#21504) (#21572)

Backport of #21504

Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
tokarchuk/v1.17
KN4CK3R 2 years ago committed by GitHub
parent 169c08e20a
commit 2ccf940464
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 4
      routers/web/auth/auth.go
  2. 4
      routers/web/auth/oauth.go

@ -613,7 +613,9 @@ func handleUserCreated(ctx *context.Context, u *user_model.User, gothUser *goth.
// update external user information // update external user information
if gothUser != nil { if gothUser != nil {
if err := externalaccount.UpdateExternalUser(u, *gothUser); err != nil { if err := externalaccount.UpdateExternalUser(u, *gothUser); err != nil {
log.Error("UpdateExternalUser failed: %v", err) if !user_model.IsErrExternalLoginUserNotExist(err) {
log.Error("UpdateExternalUser failed: %v", err)
}
} }
} }

@ -1061,7 +1061,9 @@ func handleOAuth2SignIn(ctx *context.Context, source *auth.Source, u *user_model
// update external user information // update external user information
if err := externalaccount.UpdateExternalUser(u, gothUser); err != nil { if err := externalaccount.UpdateExternalUser(u, gothUser); err != nil {
log.Error("UpdateExternalUser failed: %v", err) if !user_model.IsErrExternalLoginUserNotExist(err) {
log.Error("UpdateExternalUser failed: %v", err)
}
} }
if err := resetLocale(ctx, u); err != nil { if err := resetLocale(ctx, u); err != nil {

Loading…
Cancel
Save