1
1
mirror of https://github.com/go-gitea/gitea synced 2025-08-20 00:18:27 +00:00

Handle email address not exist (#19089) (#19121)

Backport #19089

* Handle email address not exist. (#19089)

* Fix lint about strings.Title

Co-authored-by: KN4CK3R <admin@oldschoolhack.me>
This commit is contained in:
Lunny Xiao
2022-03-19 19:35:23 +08:00
committed by GitHub
parent 9bcbbd419f
commit 79a5e68816
7 changed files with 40 additions and 28 deletions

View File

@@ -195,7 +195,7 @@ func SignInPost(ctx *context.Context) {
form := web.GetForm(ctx).(*forms.SignInForm)
u, source, err := auth_service.UserSignIn(form.UserName, form.Password)
if err != nil {
if user_model.IsErrUserNotExist(err) {
if user_model.IsErrUserNotExist(err) || user_model.IsErrEmailAddressNotExist(err) {
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) {