diff options
author | zeripath <art27@cantab.net> | 2019-07-23 18:32:53 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-07-23 18:32:53 +0100 |
commit | 2f75766532fbf30883c05e93ef01c19268216c45 (patch) | |
tree | 775854c9582a13832c87a0f3829dcdfd1714ef1b /routers | |
parent | 4334652ed15943a09a5d8baa16f0a1c24de0201e (diff) | |
download | gitea-2f75766532fbf30883c05e93ef01c19268216c45.tar.gz gitea-2f75766532fbf30883c05e93ef01c19268216c45.zip |
Handle ErrUserProhibitLogin in http git (#7586)
Diffstat (limited to 'routers')
-rw-r--r-- | routers/repo/http.go | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/routers/repo/http.go b/routers/repo/http.go index 48f5625051..26376b549d 100644 --- a/routers/repo/http.go +++ b/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.StatusUnauthorized, "User is not permitted to login") + return + } else if !models.IsErrUserNotExist(err) { ctx.ServerError("UserSignIn error: %v", err) return } |