-
Notifications
You must be signed in to change notification settings - Fork 45
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 a regression wherein users with historical usernames containing capital letters can't log in #168
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.
The non-test code / actual logic looks good to me, just test pedantry! (not that the tests were ever excellent in this project in the first place)
btw the mypy failure is unrelated to this change and has been happening for awhile. |
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.
LGTM, thanks.
If you get a moment and think the mypy shenanigans are an easy fix, that may be worth doing separately.
Introduced in #163, which attempted to allow users to authenticate with LDAP usernames containing capital letters by lowercasing the username before interacting with Synapse. This then broke logins for users with historical usernames containing uppercase letters, as the login process created an access token based on the lowercased username, which didn't actually exist. This PR fixes this by only lowercasing the username if synapse is going to create a new account for the user, and using the value returned by
check_user_exists
as the canonical username.