Browse Source

Handle ErrUserProhibitLogin in http git (#7586)

for-closed-social
zeripath 5 years ago
committed by GitHub
parent
commit
2f75766532
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 4 additions and 1 deletions
  1. +4
    -1
      routers/repo/http.go

+ 4
- 1
routers/repo/http.go View File

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

Loading…
Cancel
Save