From 257ce61023aa450e42c399a90f16a1d6f2f0fdd7 Mon Sep 17 00:00:00 2001 From: Giteabot Date: Fri, 15 Nov 2024 11:27:04 +0800 Subject: [PATCH] Fix oauth2 error handle not return immediately (#32514) (#32516) Backport #32514 by lunny Co-authored-by: Lunny Xiao --- 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 b337b6b156..b270994226 100644 --- a/routers/web/auth/oauth.go +++ b/routers/web/auth/oauth.go @@ -953,6 +953,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