dexie / Dexie.js

A Minimalistic Wrapper for IndexedDB
https://dexie.org
Apache License 2.0
11.5k stars 642 forks source link

userId case sensitivity #2032

Open phil-w opened 2 months ago

phil-w commented 2 months ago

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

So Joe.Soap@btinternet.com and Joe.Soap@BtInternet.com 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:

frankleng commented 1 month ago

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()