-
Notifications
You must be signed in to change notification settings - Fork 1k
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
[Bug?]: Standard dbAuth
username is case sensitive causing inconsistencies
#7787
Comments
usernames should probably be stored as the user types them in (i.e. case sensitive), but matched case insensitive, both for duplication checks and when logging in. @ched-dev if I can confirm that's the behavior we want, would you be interesting in trying to implement it? |
@Tobbe yes, I can work on this. I can probably put together a PR in the next couple weeks. |
Perfect! @cannikin, what do you think? |
Yep, agree! |
Great! @ched-dev please go ahead with that PR whenever you have time 🙂 |
Looking into this and having some trouble. If I try to add "case-insensitive" mode to the prisma query:
I get an error when trying to run it:
If I try to change the
While prisma says it supports case-insensitive filtering, it doesn't seem to be working in this scenario. Curious if you have any advice on how to proceed. I am a beginner prisma user, so not sure if I am approaching it wrong. |
I've done some more digging and it seems the Also, |
As you say this depends on what db the user has chosen and its best to avoid logic based on different dbs. |
I will be AFK (away from keyboard) through Apr 6 too. @ageddesi if you have time try out a fix, feel free. otherwise, I will look at it again when I get back. |
@ched-dev Hey, I will try to take a look before your back and let you know if I get somewhere. |
@ched-dev @thedavidprice |
@ageddesi Please open the PR! That's the best context for review and I can make sure the right people are looped in. Huge thanks 🙏 |
…e insensitive check on db
…or case insensitive check on db
…th (#7979) * fix(): Added userInsensitive for comparrison checks in dbAuth * Revert "fix(): Added userInsensitive for comparrison checks in dbAuth" This reverts commit 9ad34c7. * #7787 - Added new usernameMatch to SignupFlowOptions for case insensitive check on db * feat(#7787) - Added new usernameMatch to SignupFlowOptions for case insensitive check on db * feature(#7787) - Fixed failing unit test * feature(#7787) - Fix linting issues * docs(#7787) - Added supporting documentation * docs: correct Spellings in docs/docs/auth/dbauth.md Co-authored-by: Rob Cameron <cannikin@fastmail.com> --------- Co-authored-by: Rob Cameron <cannikin@fastmail.com> Co-authored-by: Tobbe Lundberg <tobbe@tlundberg.com>
… signups (#8045) * fix(): Added userInsensitive for comparrison checks in dbAuth * Revert "fix(): Added userInsensitive for comparrison checks in dbAuth" This reverts commit 9ad34c7. * #7787 - Added new usernameMatch to SignupFlowOptions for case insensitive check on db * feat(#7787) - Added new usernameMatch to SignupFlowOptions for case insensitive check on db * feature(#7787) - Fixed failing unit test * feature(#7787) - Fix linting issues * docs(#7787) - Added supporting documentation * docs: correct Spellings in docs/docs/auth/dbauth.md Co-authored-by: Rob Cameron <cannikin@fastmail.com> * doc(#7787) - Fix spelling mistake in documentation * fix(#7787) - updated check to findFirst in order to use mode checking * fix(#7877): Updated tests for dbAuthHandler --------- Co-authored-by: Rob Cameron <cannikin@fastmail.com> Co-authored-by: Tobbe Lundberg <tobbe@tlundberg.com>
Hi, |
This definitely could be a factor as well. If someone assigns a ticket to me i can add this as i know that area now. |
@dennemark Can you create an issue for this and I'll assign to @ageddesi ! |
What's not working?
Using the standard
dbAuth
strategy, username's are stored as they type in, causing possible duplicate accounts or failed logins because of mismatch.Note: It is possible to implement some additional logic within my app to solve the issue for most cases. It will not be fixed for the duplicate user check which is handled by redwood - which could cause user to create duplicate users.
How do we reproduce the bug?
Using a redwoodjs project with standard
dbAuth
flow installed:demoUser
)demouser
)What's your environment? (If it applies)
Are you interested in working on this?
The text was updated successfully, but these errors were encountered: