-
-
Notifications
You must be signed in to change notification settings - Fork 5.4k
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
Inconsistent e-mail address sync from LDAP #18603
Comments
The email in the user table should be deleted in future PRs. |
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Gitea Version
1.16-rc1
Git Version
No response
Operating System
No response
How are you running Gitea?
Compiled from source.
Database
No response
Can you reproduce the bug on the Gitea demo site?
No
Log Gist
No response
Description
According to
#4497 (comment)
LDAP sync cron task synchronizes only primary user mail; current sync code
https://github.com/go-gitea/gitea/blob/main/services/auth/source/ldap/source_sync.go#L157
updates only email column in user table and does not update extra e-mails nor is_primary state in this table.
There should be separate new method called there for consistent updating user primary e-mail (i.e. in users table and extra emails table with is_primary updating). LDAP should not add changed e-mail as new e-mail (like manual changing user email in admin panel does after #17549) but should update current primary e-mail only like it was working in gitea 1.13.
Same solution should be applied to LDAP sync code on user login if #18452 (comment) is merged.
To be considered: separate storing user primary e-mail in two separate tables is error prone. It should be kept in only one place problably to avoid such bugs.
Screenshots
No response
The text was updated successfully, but these errors were encountered: