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

userId case sensitivity #2032

Open
phil-w opened this issue Jul 8, 2024 · 1 comment
Open

userId case sensitivity #2032

phil-w opened this issue Jul 8, 2024 · 1 comment

Comments

@phil-w
Copy link

phil-w commented Jul 8, 2024

The Dexie userID is case sensitive. Which is fair enough, but it's used for email addresses, which aren't.

So [email protected] and [email protected] or any number of different combinations will all work for a user signing in, especially one on a mobile phone where auto-capitalization is not unknown. The result, is multiple independent accounts, all for a single email address (because they are one address: capitalization is ignore in email).

That's not exactly a defect, but if you end up with multiple different accounts all for a single user, you're going to have a nightmare of a manual merge operation on your hands before you're done.

My suggestions would be:

  • Anyone writing their own UI should lowercase all email stuff on the input side, so there's no risk of alternative casings getting into the wild.
  • Dexie, should probably not treat the same email address as different based on case alone, or could support some option which lowercases everything on input to avoid the mess.
@frankleng
Copy link

best to lowercase them during form validate/sanitize step before persisting data

it's not a Dexie limitation but Indexeddb.
if u must handle this on browser - see middleware https://dexie.org/docs/Dexie/Dexie.use()

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

2 participants