Handle ErrUserProhibitLogin in http git (#7586, #7591) (#7590)

* Handle ErrUserProhibitLogin in http git (#7586)

* Use 403
pull/7618/head
zeripath 6 years ago committed by techknowlogick
parent adb43358bc
commit 5a3d9861ba
  1. 5
      routers/repo/http.go

@ -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
}

Loading…
Cancel
Save