Skip to content

Commit 2984b9d

Browse files
committed
Prevent panic on prohibited user login with oauth2
There was an unfortunate regression in go-gitea#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 go-gitea#18561 Signed-off-by: Andrew Thornton <[email protected]>
1 parent 76e3111 commit 2984b9d

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
@@ -822,7 +822,7 @@ func SignInOAuthCallback(ctx *context.Context) {
822822
u, gothUser, err := oAuth2UserLoginCallback(authSource, ctx.Req, ctx.Resp)
823823
if err != nil {
824824
if user_model.IsErrUserProhibitLogin(err) {
825-
uplerr := err.(*user_model.ErrUserProhibitLogin)
825+
uplerr := err.(user_model.ErrUserProhibitLogin)
826826
log.Info("Failed authentication attempt for %s from %s: %v", uplerr.Name, ctx.RemoteAddr(), err)
827827
ctx.Data["Title"] = ctx.Tr("auth.prohibit_login")
828828
ctx.HTML(http.StatusOK, "user/auth/prohibit_login")

0 commit comments

Comments
 (0)