diff --git a/routers/web/auth/auth.go b/routers/web/auth/auth.go index ea5c7232a8..bda6789d8d 100644 --- a/routers/web/auth/auth.go +++ b/routers/web/auth/auth.go @@ -613,7 +613,9 @@ func handleUserCreated(ctx *context.Context, u *user_model.User, gothUser *goth. // update external user information if gothUser != 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) + } } } diff --git a/routers/web/auth/oauth.go b/routers/web/auth/oauth.go index a9fc39d019..0492d30656 100644 --- a/routers/web/auth/oauth.go +++ b/routers/web/auth/oauth.go @@ -1061,7 +1061,9 @@ func handleOAuth2SignIn(ctx *context.Context, source *auth.Source, u *user_model // update external user information 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 {