Skip to content

fix: make username queries case fixes (#223) - #236

Open
KavinRaj117 wants to merge 3 commits into
developfrom
fix/case-insensitive-usernames
Open

KavinRaj117 wants to merge 3 commits into
developfrom
fix/case-insensitive-usernames

Conversation

@KavinRaj117

Copy link
Copy Markdown
Contributor

Resolves #223. Updates usernameSchema to transform usernames to lowercase on input, and changes eq checks to case insensitive ilike queries in the userMetadataRouter.

Tested it locally by checking the case sensitive usernames and updates ( although im not sure it will work a 100 percent tho)

@KavinRaj117
KavinRaj117 requested review from a team as code owners September 16, 2026 23:27
@vercel

vercel Bot commented Sep 16, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
utd-notebook Ready Ready Preview Sep 21, 2026 2:37pm UTC

Request Review

@ZeyadAbbas ZeyadAbbas left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you please make these changes:

  • Convert the username input to lowercase as the user types, including when Caps Lock is enabled. So the input should only show lowercase.
  • On the server, convert the username to lowercase before checking availability and saving it.
  • Check for an existing username using eq after normalization like before, rather than ilike.
  • Allow letters, numbers, hyphens, underscores, and dots.

This ensures frontend validation cannot be bypassed and usernames are always stored consistently in lowercase.

@KavinRaj117

Copy link
Copy Markdown
Contributor Author

Hey @ZeyadAbbas, I've updated the PR to force lowercase input on the frontend as the user types, updated the schema to allow dots, normalized server inputs with .toLowerCase(), and switched the queries back to eq

@justinschwerdtfeger

Copy link
Copy Markdown
Contributor

@KavinRaj117 Perhaps you forgot to commit, but I do not see these changes

This branch was successfully deployed

1 active deployment
Preview — 264e7f25 Deployed Sep 21, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Usernames can be repeated

3 participants