fix(web3): normalize Ethereum addresses to lowercase to prevent case-… #2265
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.
fix(web3): normalize Ethereum addresses to lowercase to prevent case-sensitivity issues #2264
What kind of change does this PR introduce?
Bug fix - Resolves case-sensitivity issues with Ethereum addresses in SIWE (Sign-In with Ethereum) implementation.
What is the current behavior?
Ethereum addresses are stored with their original case (EIP-55 checksum format uses mixed case). This causes lookup failures when users sign in with a different case representation of the same address, as
provider_idmatching is case-sensitive.What is the new behavior?
Ethereum addresses are now normalized to lowercase at parse time in
parser.go. This ensures consistent storage and lookup regardless of the case used during sign-in.Changes:
internal/utilities/siwe/parser.go- Normalize address to lowercaseinternal/utilities/siwe/parser_test.go- Update test expectationsMigration Notes
This fix applies to new signups only. Existing users with checksummed Ethereum addresses in
provider_idmay need manual migration.For existing deployments with web3 users:
Note: For large tables, consider running in batches to avoid long locks.
Additional context
auth.identitiestables