aboutsummaryrefslogtreecommitdiffstats
path: root/routers/web/auth/auth.go
diff options
context:
space:
mode:
authorLunny Xiao <xiaolunwen@gmail.com>2023-07-04 06:39:38 +0800
committerGitHub <noreply@github.com>2023-07-03 18:39:38 -0400
commit0403bd989f60ab84497eb5e04366496b3c9d2534 (patch)
tree24ab2e5052a6d4bffc61bb6771073a2b0f84ec12 /routers/web/auth/auth.go
parentad57be04b87d16ff509da4f1632d444b75eb9efc (diff)
downloadgitea-0403bd989f60ab84497eb5e04366496b3c9d2534.tar.gz
gitea-0403bd989f60ab84497eb5e04366496b3c9d2534.zip
Log the real reason when authentication fails (but don't show the user) (#25414)
Diffstat (limited to 'routers/web/auth/auth.go')
-rw-r--r--routers/web/auth/auth.go2
1 files changed, 1 insertions, 1 deletions
diff --git a/routers/web/auth/auth.go b/routers/web/auth/auth.go
index bc8f6d58c9..9dcc38247d 100644
--- a/routers/web/auth/auth.go
+++ b/routers/web/auth/auth.go
@@ -201,7 +201,7 @@ func SignInPost(ctx *context.Context) {
u, source, err := auth_service.UserSignIn(form.UserName, form.Password)
if err != nil {
- if user_model.IsErrUserNotExist(err) || user_model.IsErrEmailAddressNotExist(err) {
+ if errors.Is(err, util.ErrNotExist) || errors.Is(err, util.ErrInvalidArgument) {
ctx.RenderWithErr(ctx.Tr("form.username_password_incorrect"), tplSignIn, &form)
log.Info("Failed authentication attempt for %s from %s: %v", form.UserName, ctx.RemoteAddr(), err)
} else if user_model.IsErrEmailAlreadyUsed(err) {