Skip to content

Commit

Permalink
Handle ErrUserProhibitLogin in http git (#7586)
Browse files Browse the repository at this point in the history
  • Loading branch information
zeripath committed Jul 23, 2019
1 parent 4334652 commit 2f75766
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion routers/repo/http.go
Original file line number Diff line number Diff line change
Expand Up @@ -215,7 +215,10 @@ func HTTP(ctx *context.Context) {
// Check username and password
authUser, err = models.UserSignIn(authUsername, authPasswd)
if err != nil {
if !models.IsErrUserNotExist(err) {
if models.IsErrUserProhibitLogin(err) {
ctx.HandleText(http.StatusUnauthorized, "User is not permitted to login")
return
} else if !models.IsErrUserNotExist(err) {
ctx.ServerError("UserSignIn error: %v", err)
return
}
Expand Down

0 comments on commit 2f75766

Please sign in to comment.