summaryrefslogtreecommitdiffstats
path: root/routers
diff options
context:
space:
mode:
authorzeripath <art27@cantab.net>2019-07-23 18:32:53 +0100
committerGitHub <noreply@github.com>2019-07-23 18:32:53 +0100
commit2f75766532fbf30883c05e93ef01c19268216c45 (patch)
tree775854c9582a13832c87a0f3829dcdfd1714ef1b /routers
parent4334652ed15943a09a5d8baa16f0a1c24de0201e (diff)
downloadgitea-2f75766532fbf30883c05e93ef01c19268216c45.tar.gz
gitea-2f75766532fbf30883c05e93ef01c19268216c45.zip
Handle ErrUserProhibitLogin in http git (#7586)
Diffstat (limited to 'routers')
-rw-r--r--routers/repo/http.go5
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
}