Skip to content

Use email_address table to check user's email when login with email address #18769

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

Closed
wants to merge 5 commits into from

Conversation

lunny
Copy link
Member

@lunny lunny commented Feb 14, 2022

It's not clear what's the problem of the bug, but I think we should get the data from email_address table but not from user table now. It's amazing the test is wrong from 4 years ago.

Fix #18547

@GiteaBot GiteaBot added the lgtm/need 2 This PR needs two approvals by maintainers to be considered for merging. label Feb 14, 2022
@lunny lunny force-pushed the lunny/fix_ldap branch 2 times, most recently from e7eda2a to aa4315d Compare February 15, 2022 17:11
@lunny lunny changed the title WIP: Use email_address table to check user's email when login with email address Use email_address table to check user's email when login with email address Feb 16, 2022
@GiteaBot GiteaBot added lgtm/need 1 This PR needs approval from one additional maintainer to be merged. and removed lgtm/need 2 This PR needs two approvals by maintainers to be considered for merging. labels Feb 16, 2022
@johanvdw
Copy link
Contributor

johanvdw commented Feb 16, 2022

I think this is a useful addition (I can now login with different email addresses than the main email address is using local authentication. However, it does not fix #18547

If I set login_source to ldap I'm still not able to login using email, nor using username if the username is not equal to the login_name (Authentication Sign-In Name).

this error is logged (i had to switch to more verbose logging):

2022/02/16 23:31:25 ...ers/web/auth/auth.go:200:SignInPost() [I] Failed authentication attempt for johan@xxxx from [::1]:34610: user does not exist [uid: 0, name: johan@xxx, keyid: 0]

the same error is shown when I login using my username.

I think that the mapping to login_name is just not happening anymore.

@johanvdw johanvdw mentioned this pull request Feb 16, 2022
@lunny
Copy link
Member Author

lunny commented Feb 18, 2022

replaced by #18789. @zeripath Could you review that PR again?

@lunny lunny closed this Feb 18, 2022
@lunny lunny deleted the lunny/fix_ldap branch February 18, 2022 07:43
@go-gitea go-gitea locked and limited conversation to collaborators Apr 28, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
lgtm/need 1 This PR needs approval from one additional maintainer to be merged.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Unable to login using e-mail (LDAP)
4 participants