Skip to content

Commit 6591f87

Browse files
Fix login with email for ldap users (#18800) (#18836)
`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. Co-authored-by: techknowlogick <[email protected]>
1 parent efc78c1 commit 6591f87

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
@@ -65,7 +65,7 @@ func UserSignIn(username, password string) (*user_model.User, *auth.Source, erro
6565
return nil, nil, smtp.ErrUnsupportedLoginType
6666
}
6767

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

0 commit comments

Comments
 (0)