Is there any way to create custom recoverEmail link in firebase/firebase-admin?
I've checked the docs and tutorials there's none. Any help would be great!
From my understanding there is currently no solution for this within the SDK. Instead, we took the approach of using admin.auth().generateSignInWithEmailLink(email, actionCodeSettings)
and then replacing the mode
within the returned link
from signIn
to recoverEmail
.
const updatedLink = link.replace('signIn', 'recoverEmail');
This allowed us to customise the auth
handler action as suggested here Create the email action handler page in the Firbase documentation.
Now we are able to call on admin.auth().updateUser
again to reset the email to it's previous, along with update across our databases, merchant and other services. You'll also need to add the original email to a query in the updatedLink
too.
const linkWithOriginalEmail = updatedLink.concat(`&email=${email}`)
Hope that helps and if anyone has a better solution we'd love to discuss.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With