SamanthaGuillemette / SOEN390

SOEN390 Project
MIT License
5 stars 0 forks source link

Emails are Case Sensitive #285

Closed MarwaKhalid closed 2 years ago

MarwaKhalid commented 2 years ago

Emails are case sensitive, this means if we are trying to find the user's document based on their email, we MUST take into account the cases otherwise our application won't find the document in firebase.

auth.currentUser?.email; DOES NOT WORK! it stores the email as lowercase!

smarkandu commented 2 years ago

Assigned to @tusharraval102 since he deals with credentials/authentication.

smarkandu commented 2 years ago

I looks like when we login, whatever we enter needs to match exactly (case sensitivity) whats stored in the DB for the email (since we use it as "key" for both the Admin and Client table):

image

I'd recommend setting the key/email to either all lowercase (like that for credentials) when we first create the key in the DB, then whenever we try to access it, we do the same for the requested key when we try to query for it (that way, both are in sync).

Note that when we do the fix, we'll also have to fix existing entries in the DB. Since we cant change keys in firebase, we'll probably have to delete those entries.

smarkandu commented 2 years ago

Example of a bad entry in the DB:

image