firebase / firebase/snippets-web

Improve accuracy of account linking snippets for Auth

Open
#203 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
JavaScript
Stars
802
Forks
285
PR merge metrics
No merged PRs in 30d

Description

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?

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.