Skip to content

Commit 2f75766

Browse files
authored
Handle ErrUserProhibitLogin in http git (#7586)
1 parent 4334652 commit 2f75766

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

routers/repo/http.go

+4-1
Original file line numberDiff line numberDiff line change
@@ -215,7 +215,10 @@ func HTTP(ctx *context.Context) {
215215
// Check username and password
216216
authUser, err = models.UserSignIn(authUsername, authPasswd)
217217
if err != nil {
218-
if !models.IsErrUserNotExist(err) {
218+
if models.IsErrUserProhibitLogin(err) {
219+
ctx.HandleText(http.StatusUnauthorized, "User is not permitted to login")
220+
return
221+
} else if !models.IsErrUserNotExist(err) {
219222
ctx.ServerError("UserSignIn error: %v", err)
220223
return
221224
}

0 commit comments

Comments
 (0)