From 96ee0f56475204b2bbdc7f2aeb35b1c32eac469c Mon Sep 17 00:00:00 2001 From: Lunny Xiao Date: Thu, 14 Nov 2024 18:13:01 -0800 Subject: [PATCH] Fix oauth2 error handle not return immediately (#32514) (cherry picked from commit 4121f952d18a4c3a3c08ae645af3458ef08b439d) --- routers/web/auth/oauth.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/routers/web/auth/oauth.go b/routers/web/auth/oauth.go index a9cbce9a9d..bf197bd14d 100644 --- a/routers/web/auth/oauth.go +++ b/routers/web/auth/oauth.go @@ -1013,6 +1013,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