-
Notifications
You must be signed in to change notification settings - Fork 66
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: User name is overwritten when logging in via Wikimedia SSO #286
Fix: User name is overwritten when logging in via Wikimedia SSO #286
Conversation
Reviewer's Guide by SourceryThis pull request fixes an issue where a user's name would be overwritten when logging in via Wikimedia SSO, even if the user already had a name set. The fix ensures that the user's name is only updated if it is not already set. Sequence diagram for user login via Wikimedia SSOsequenceDiagram
participant User
participant OAuth2 Provider
participant pretalx
User->>OAuth2 Provider: Authenticates via Wikimedia SSO
OAuth2 Provider-->>User: Returns user information (email, name, etc.)
User->>pretalx: Logs in with OAuth2
pretalx->>pretalx: Get or create user by email
alt User is new
pretalx->>pretalx: Set unusable password
end
alt User name is not set AND upstream name is available
pretalx->>pretalx: Update user name
end
pretalx->>pretalx: Set user active and staff status
pretalx-->>User: Logs user in
File-Level Changes
Assessment against linked issues
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
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.
Hey @hongquan - I've reviewed your changes - here's some feedback:
Overall Comments:
- Consider adding a comment explaining why the user's name should only be set if it's currently empty.
Here's what I looked at during the review
- 🟢 General issues: all looks good
- 🟢 Security: all looks good
- 🟢 Testing: all looks good
- 🟢 Complexity: all looks good
- 🟢 Documentation: all looks good
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.
More fix for #278
The previous fix #279 is not enough, because it solves the case that user logins with email address.
This PR solves the case when user logins via Wikimedia SSO
How has this been tested?
There is no screenshot because I cannot reproduce the bug in my localhost: Wikimedia refuses logging-in, may be because the domain I use for localhost is not valid.
Checklist
Summary by Sourcery
Bug Fixes: