From 439b2411a3f0367406cc4d0ddee521c7cf0c1a75 Mon Sep 17 00:00:00 2001 From: Andrew Thornton Date: Tue, 23 Jul 2019 13:19:56 +0100 Subject: [PATCH] Handle ErrUserProhibitLogin in http git --- routers/repo/http.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/routers/repo/http.go b/routers/repo/http.go index 48f562505131e..26376b549d0a0 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 }