fix: case-insensitive email lookup for authentication#584
Open
nora-weisser wants to merge 3 commits intomainfrom
Open
fix: case-insensitive email lookup for authentication#584nora-weisser wants to merge 3 commits intomainfrom
nora-weisser wants to merge 3 commits intomainfrom
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub. 1 Skipped Deployment
|
dricazenck
reviewed
Mar 27, 2026
dricazenck
approved these changes
Mar 28, 2026
dricazenck
reviewed
Mar 29, 2026
| private static final String SQL_SELECT_BY_ID = "SELECT * FROM user_accounts WHERE id = ?"; | ||
| private static final String SQL_SELECT_BY_MAIL = "SELECT * FROM user_accounts WHERE email = ?"; | ||
| private static final String SQL_SELECT_BY_MAIL = | ||
| "SELECT * FROM user_accounts WHERE LOWER(email) = LOWER(?)"; |
Collaborator
There was a problem hiding this comment.
I don't think we should add this complexity to the database, but should be in the service to always ignore-case to compare emails. Probably we can add before save member data.
MemberMapper.addMember#
...
var email= member.getEmail().toLowerCase(Locale.ENGLISH);
final var existingMemberId = findMemberIdByEmail(email);
jdbc.update(
INSERT,
member.getFullName(),
member.getSlackDisplayName(),
member.getPosition(),
member.getCompanyName(),
email,
member.getCity(),
getCountryId(member.getCountry()),
defaultStatusPending,
member.getPronouns(),
getPronounCategoryId(member.getPronounCategory()),
member.getIsWomen());
Contributor
Author
There was a problem hiding this comment.
I made these changes, could you please take a look? Thanks!
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.



Problem
Login was case-sensitive —
admin@wcc.devandAdmin@wcc.devwere treated as different accounts, causing 401 for users who registered or were seeded with a different email casing than what they typed at login.Change Type