new Firebase Authentication trigger
firebase currently has two firebase auth triggers:
functions.auth.user().onCreate()
functions.auth.user().onDelete()
I would like a trigger to respond to onLinkWithCredential so that I can update the user document in the user collection with the additional/changes from the new auth method
-
Mihey Matev commented
Oddly enough, from what I can tell, if a user created an anonymous account and then links it to their email (whether or not they've linked it to for example Google), the onCreate() trigger gets called a second time (first time being when the anonymous account was created).
However, onCreate() doesn't trigger when linking to Google.Just feels a bit inconsistent.
-
Fernando villarreal commented
Two keep secure
-
David Robertson (Davie) commented
Here's another reason. I have a users/{user} document that's used to store a user's profile.
It's often created when users register via email and password, I then force a linkWithPhoneNumber to verify the user.
but I have enabled:
User account linking
When a user signs in using different identity providers, you can choose to automatically merge accounts on sign in.So I cannot make changes to the document associated with that user, and most of the details of the user need to be updated - and in the case of them doing a Google login then phone and email account are no longer viable auth methods