The Firebase Customize the Email Action Handler guide gives an example of verifying a user's email address on a custom URL to a site hosted through Firebase.
However, I want the custom URL to point to a Firebase cloud function endpoint URL and use admin SDK to verify the oob code instead. But there is no such function as applyActionCode
for the admin.auth()
.
Is verifying email through a hosted site using javascript the only way to go? I don't really want to expose the code to the browser.
As of 3/8/2020, this applyActionCode
is not part of the admin sdk. A kludge for this will be to verify the oobCode on the server/backend/cloud function using the rest api
https://firebase.google.com/docs/reference/rest/auth/#section-send-email-verification.
How? since you customized the email action handler, assume it is pointed to an endpoint you have control over (e.g your domain/cloud function), then on the client side, you can obtain the url parameters (including the oobcode) in the url and send to your backend for verification using the REST API.
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