Skip to content

Commit ddcf2e7

Browse files
committed
Fix login with email for ldap users (go-gitea#18800)
`authenticator.Authenticate` has assume the login name is not an email, but `username` maybe an email. So when we find the user via email address, we should use `user.LoginName` instead of `username` which is an email address.
1 parent bec5662 commit ddcf2e7

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

services/auth/signin.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ func UserSignIn(username, password string) (*user_model.User, *auth.Source, erro
6464
return nil, nil, smtp.ErrUnsupportedLoginType
6565
}
6666

67-
user, err := authenticator.Authenticate(user, username, password)
67+
user, err := authenticator.Authenticate(user, user.LoginName, password)
6868
if err != nil {
6969
return nil, nil, err
7070
}

0 commit comments

Comments
 (0)