Skip to content

Improve accuracy of account linking snippets for Auth #203

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

Open
samtstern opened this issue Jul 16, 2021 · 0 comments
Open

Improve accuracy of account linking snippets for Auth #203

samtstern opened this issue Jul 16, 2021 · 0 comments

Comments

@samtstern
Copy link
Contributor

This (old) email thread explains some of the shortcomings with our snippets on this page:
https://groups.google.com/d/msgid/firebase-talk/86666e16-7489-43fd-a357-96b39d56d546%40googlegroups.com?utm_medium=email&utm_source=footer

The file in question is:
https://github.com/firebase/snippets-web/blob/cee9068490fbfb03c123fbda87bc08a73a122520/auth/link-multiple-accounts.js

To quote the thread:

line 128 I believe should be:

repo.delete(prevUserData);

line 153 I don't think is needed or works as it's out of scope

line 140 & the chained logic I'm unsure of. I'm approaching differently since I'm only going from anonymous to permanent & I don't need the anonymous account anymore at this point so I delete it & merge data into the signed in account.

I know you're keeping it brief but I think this could fail if the linked account is already linked so might at least want a note about it 🤷‍♂️ Also I haven't tried in this context, but once you've linked the credential can't you just merge w/out signing in again?

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

1 participant