]> source.dussan.org Git - gitea.git/commitdiff
Fix oauth2 error handle not return immediately (#32514)
authorLunny Xiao <xiaolunwen@gmail.com>
Fri, 15 Nov 2024 02:13:01 +0000 (18:13 -0800)
committerGitHub <noreply@github.com>
Fri, 15 Nov 2024 02:13:01 +0000 (02:13 +0000)
routers/web/auth/oauth.go

index 730d68051be38f3c43a02d67e2a44dc7a8a5d47a..75f94de0edad77f46edccaea5933cf24a0468ed8 100644 (file)
@@ -122,6 +122,8 @@ func SignInOAuthCallback(ctx *context.Context) {
                }
                if err, ok := err.(*go_oauth2.RetrieveError); ok {
                        ctx.Flash.Error("OAuth2 RetrieveError: "+err.Error(), true)
+                       ctx.Redirect(setting.AppSubURL + "/user/login")
+                       return
                }
                ctx.ServerError("UserSignIn", err)
                return