CMPUT301W20T12 / GufyGuber

Meant to version work on the term project for CMPUT 301
Apache License 2.0
0 stars 1 forks source link

Email not updating in firebase #35

Closed dijonron closed 4 years ago

dijonron commented 4 years ago

Updating user email will change in "users" collection in firestore, but will not change the email associated with the authenticated firestore UID

dijonron commented 4 years ago

might have to delete the current gmail authentication account, and authenticate the new updated email

dijonron commented 4 years ago

would need to update the UID then as well

rmacgill commented 4 years ago

I think @hmp31 had mentioned researching a solution for this that would maintain the UID (which is kind of essential since all of our records are keyed with the UID).

hmp31 commented 4 years ago

I don't know if we have the option to explicitly set the uid for the user with google sign in like we did with the normal email/password (I still need to confirm this).

dijonron commented 4 years ago

The more I look into it, it seems like we cannot just update the email for Google Auth user. Firebase gets authorization credentials for the GoogleSignInClient, so I think we would have to repeat this step and make a new account and sync up the new UID with all the other data on the user. I'm also not sure if we can just pass the gmail string to do this, or if we would need to utilize the whole google account selector fragment again to get all the credentials. Unless you were able to find another way @hmp31 ?

Either way, I'm going to update the SP on this.

hmp31 commented 4 years ago

I don't believe we have a problem here. Updating the email does indeed change the email associated with both the authentication account and the user table, at least from my build. I was able to sign in with one account, verify my credentials on firebase, change my email, verify my new credentials on firebase and sign in with the other account.