Skip to content
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

Add support for case-insensitive usernames #752

Closed
shayneczyzewski opened this issue Oct 13, 2022 · 2 comments
Closed

Add support for case-insensitive usernames #752

shayneczyzewski opened this issue Oct 13, 2022 · 2 comments

Comments

@shayneczyzewski
Copy link
Contributor

Is your feature request related to a problem? Please describe.
Currently, the username field for auth is just a String that is used as-is, and thus, is case-sensitive.

Describe the solution you'd like
It would be nice for UX if we had some support for making them case-insensitive so that "shayne" and "Shayne" would be considered the same username.

Describe alternatives you've considered
We could make this a new flag on the auth dictionary, or maybe also provide some Prisma middleware to handle it so they could do even more elaborate things to normalize.

@sodic
Copy link
Contributor

sodic commented Dec 8, 2022

I think the best approach is starting with a middleware for "mapping" usernames.

Case insensitivity doesn't seem like a property that's intrinsic enough to earn an extra special field inside the language (e.g., as opposed to something like stripping numbers or underscores).

If it proves popular enough and ends up making over 90% of users' middlewares, then sure, we can add it in.

@infomiho
Copy link
Contributor

Since #1583 we have standardised the way we save auth provider user IDs: we lowercase them always. That's what's also recommended by OWASP anyways: https://owasp.deteact.com/cheat/cheatsheets/Authentication_Cheat_Sheet.html#user-ids

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

No branches or pull requests

4 participants