starter
starter copied to clipboard
fix: make username sanitization case-insensitive (#284)
Description
Fixes #284, makes username sanitization case-insensitive to avoid potential conflicts when creating account using oauth providers.
Performance impact
Should be minimal (using lower() 3x in sanitization loop, potentially could be optimized by only running it once and assigning to a variable, is it worth it?
Security impact
None.
Checklist
- [x] My code matches the project's code style and
yarn lint:fixpasses. - [ ] I've added tests for the new feature, and
yarn testpasses. - [ ] I have detailed the new feature in the relevant documentation.
- [ ] I have added this feature to 'Pending' in the
RELEASE_NOTES.mdfile (if one exists). - [ ] If this is a breaking change I've explained why.
Is this actually required? Username is citext so it should already be compared case insensitively…
Ah the comparison is text due to concat; we should case the result of concat back to citext.