Skip to content

Commit 16d4deb

Browse files
committed
Prevent panic on prohibited user login with oauth2 (go-gitea#18562)
Backport go-gitea#18562 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 0dfe5fa commit 16d4deb

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

routers/web/auth/oauth.go

+1-1
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)