Browse Source

use 403 instead of 401 for ErrUserProhibitLogin (#7591)

tags/v1.11.0-dev
zeripath GitHub 6 years ago
parent
commit
d4ae5a4ec3
1 changed files with 1 additions and 1 deletions
  1. +1
    -1
      routers/repo/http.go

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

@@ -216,7 +216,7 @@ func HTTP(ctx *context.Context) {
authUser, err = models.UserSignIn(authUsername, authPasswd)
if err != nil {
if models.IsErrUserProhibitLogin(err) {
ctx.HandleText(http.StatusUnauthorized, "User is not permitted to login")
ctx.HandleText(http.StatusForbidden, "User is not permitted to login")
return
} else if !models.IsErrUserNotExist(err) {
ctx.ServerError("UserSignIn error: %v", err)


Loading…
Cancel
Save