-
-
Notifications
You must be signed in to change notification settings - Fork 5.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix login with email for ldap users #18800
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is better also because username may need to be sanitized to trim spaces and should not be used as-is for Authenticate.
Are we sure about this? I guess this is right, the user has created a new username-alias pair for gitea so when they're logging in they actually mean |
Codecov Report
@@ Coverage Diff @@
## main #18800 +/- ##
=======================================
Coverage ? 46.49%
=======================================
Files ? 853
Lines ? 122473
Branches ? 0
=======================================
Hits ? 56947
Misses ? 58638
Partials ? 6888
Continue to review full report at Codecov.
|
make lgtm work |
`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.
* giteaofficial/main: [skip ci] Updated translations via Crowdin Show fullname on issue edits and gpg/ssh signing info (go-gitea#18827) Update go-org to 1.6.0 (go-gitea#18824) Fix login with email for ldap users (go-gitea#18800) [skip ci] Updated licenses and gitignores Immediately Hammer if second kill is sent (go-gitea#18823)
`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 <techknowlogick@gitea.io>
`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.
authenticator.Authenticate
has assume the login name is not an email, butusername
maybe an email. So when we find the user via email address, we should useuser.LoginName
instead ofusername
which is an email address.