Skip to content

Update email.js #89

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

Merged
merged 3 commits into from
Jan 21, 2021
Merged

Update email.js #89

merged 3 commits into from
Jan 21, 2021

Conversation

puf
Copy link
Contributor

@puf puf commented Jan 21, 2021

The promises for signInWithEmailAndPassword and createUserWithEmailAndPassword resolve with a UserCredential and not a user. Calling the parameter user is a left-over from the old (pre-5.0) SDK where it was an actual FirebaseUser object.

I renamed the parameter and added an example of how to access the UID, which is the most common action for developers after creating an account/signing in.

Context: https://stackoverflow.com/questions/65817351/did-firebase-createuserwithemailandpassword-change-the-return-value/65817541?noredirect=1#comment116371334_65817541

The promises for `signInWithEmailAndPassword` and `createUserWithEmailAndPassword` resolve with a `UserCredential` and not a user. Calling the parameter `user` is a left-over from the old (pre-5.0) SDK where it was an actual `FirebaseUser` object.

I renamed the parameter and added an example of how to access the UID, which is the most common action for developers after creating an account/signing in.
@puf puf added the bug label Jan 21, 2021
@puf puf requested a review from samtstern January 21, 2021 00:02
@samtstern
Copy link
Contributor

@puf thanks for noticing this! I fixed it in a few more spots as well.

Btw for every snippet in this repo there is a parallel vNext snippet. So auth/email.js and auth-next/email.js are parallel. And then running npm run snippets generates some of the final vNext snippets from those sources.

@samtstern samtstern merged commit a808a4b into master Jan 21, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants