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

identityField is case sensitive for authentication #6844

Open
gautamsi opened this issue Oct 27, 2021 · 2 comments
Open

identityField is case sensitive for authentication #6844

gautamsi opened this issue Oct 27, 2021 · 2 comments
Labels
🐛 bug Unresolved bug

Comments

@gautamsi
Copy link
Member

Bug report

Describe the bug

Not sure if this is exactly bug or some configuration is needed.

I noticed that authentication does not ignore case when matching identityField.

To Reproduce

  1. Run auth example
  2. crate user with first letter of email capitalize
  3. try signing in using all small letters in email using graphql playground

Expected behaviour

authentication should succeed

Screenshots

If applicable, add screenshots to help explain your problem.

System information

NA

@JedWatson
Copy link
Member

@gautamsi I've looked at this, and agree it's an issue, but not one with a solution we can implement quickly to fix things.

Not sure when we're going to prioritise this, but here's the current state of things:

Long story short, case sensitivity is handled differently with Postgres and Sqlite, so we can't just add a { mode: "insensitive" } option to the mutation unfortunately. Also (from my read, haven't gone down the entire rabbit hole yet) we expect a unique index on the identity field and the way that translates to database support is case sensitive (which is another problem), more info here: prisma/prisma#3851

What we'll probably do is introduce a new option (or maybe new field) that forces input to lowercase, put the unique constraint on that, and lowercase the input we're comparing against as well. But it needs some thinking and design.

@bladey bladey added the 🐛 bug Unresolved bug label Nov 7, 2021
@emmatown emmatown added issue/features and removed 🐛 bug Unresolved bug labels Nov 16, 2021
@dcousens dcousens added the 🐛 bug Unresolved bug label Jun 19, 2023
@pc-erin
Copy link

pc-erin commented Jan 22, 2024

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🐛 bug Unresolved bug
Projects
None yet
Development

No branches or pull requests

6 participants