Skip to content

Commit

Permalink
Handle ErrUserProhibitLogin in http git (#7586, #7591) (#7590)
Browse files Browse the repository at this point in the history
* Handle ErrUserProhibitLogin in http git (#7586)

* Use 403
  • Loading branch information
zeripath authored and techknowlogick committed Jul 23, 2019
1 parent adb4335 commit 5a3d986
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.StatusForbidden, "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 5a3d986

Please sign in to comment.