Skip to content

Commit 8d31cfb

Browse files
authored
Prevent panic on prohibited user login with oauth2 (#18562) (#18563)
Backport #18562 There was an unfortunate regression in #17962 where following detection of the UserProhibitLogin error the err is cast to a pointer by mistake. This causes a panic due to an interface error. Fix #18561 Signed-off-by: Andrew Thornton <[email protected]>
1 parent e84a432 commit 8d31cfb

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

routers/web/auth/oauth.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -826,7 +826,7 @@ func SignInOAuthCallback(ctx *context.Context) {
826826
u, gothUser, err := oAuth2UserLoginCallback(authSource, ctx.Req, ctx.Resp)
827827
if err != nil {
828828
if user_model.IsErrUserProhibitLogin(err) {
829-
uplerr := err.(*user_model.ErrUserProhibitLogin)
829+
uplerr := err.(user_model.ErrUserProhibitLogin)
830830
log.Info("Failed authentication attempt for %s from %s: %v", uplerr.Name, ctx.RemoteAddr(), err)
831831
ctx.Data["Title"] = ctx.Tr("auth.prohibit_login")
832832
ctx.HTML(http.StatusOK, "user/auth/prohibit_login")

0 commit comments

Comments
 (0)