在服务器/管理员上创建帐户后发送Firebase重置密码电子邮件 [英] Send Firebase Reset Password Email After Account Created On Server/Admin

查看:67
本文介绍了在服务器/管理员上创建帐户后发送Firebase重置密码电子邮件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在创建一个网站,企业可以在此网站上免费向其客户/用户提供我的服务.对于要添加用户的企业(在其企业帐户下),企业登录并输入其客户/用户电子邮件之一.然后,我将客户端/用户电子邮件发送给firebase函数并以编程方式创建一个帐户.

I'm creating a website where businesses can offer my service to their clients/users for free. For a business to add a user (under their business account), the business logs in and inputs one of their clients/users email. I then send the client/user email to firebase functions and programmatically create an account.

我想向该新用户发送一封电子邮件,上面写着创建帐户:重置密码"之类的内容,我可以使用浏览器上的sendPasswordResetEmail来执行此操作,但是此功能在Firebase功能/管理员上不可用.

I would like to send this new user a email saying something like 'Account Created: Reset Password' etc., I could do this using sendPasswordResetEmail on the browser, but this function is not available on Firebase functions/admin.

我认为最好的选择是为每个新用户随机生成一个密码(即"ef53gs"),并在欢迎电子邮件"中共享新密码,但是如果您使用欢迎",我认为这将是更好的体验电子邮件中包含一个链接,可用于(重新)设置其密码.

The best option I can think of it to randomly generate a password for each new user (ie - 'ef53gs'), and share the new password in a Welcome Email, but I think it would be a better experience if the Welcome Email included a link to (re)set their password.

有什么主意如何使诸如sendPasswordResetEmail之类的东西可用于Firebase函数?

Any idea's how to make something like sendPasswordResetEmail work for firebase functions?

推荐答案

我们遇到了相同的问题,因为firebase-admin没有像firebase SDK那样的sendPasswordResetEmail().我们最终只使用了服务器上的firebase客户端SDK以及firebase-admin.效果很好.

We ran into the same issue since the firebase-admin does not have a sendPasswordResetEmail() like the firebase SDK does. We ended up just using the firebase client SDK on the server as well alongside the firebase-admin. Works fine.

这篇关于在服务器/管理员上创建帐户后发送Firebase重置密码电子邮件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆