Is there a way to send the verification email with the Firebase Admin SDK from my Node.js server?

百般思念 提交于 2019-12-18 06:06:32

问题


Is there a way to send the email verification email from my server ?

This is how it's done on the client:

authData.sendEmailVerification().then(function() {

Is there a way to do it on the server ?


回答1:


firebaser here

To my surprise there currently is no option to send verification email from within the Admin SDK. I'd recommend you file a feature request.

What you can do from the Admin SDK is update a user profile to mark their email as verified. This allows you to take control of the entire verification flow if you want to, finishing with a call to admin.auth().updateUser(...) (on Node.js, see the link for other supported languages).




回答2:


I just came across the same problem as you. There is a function to generate the verification link using user's email address.

I used this function on an array of email addresses, then load the result to my mail automation API to send mails out. This function is weirdly not documented:

admin.auth().generateEmailVerificationLink([EMAIL_ADDRESS])


来源:https://stackoverflow.com/questions/44547671/is-there-a-way-to-send-the-verification-email-with-the-firebase-admin-sdk-from-m

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!