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

查看:27
本文介绍了在服务器/管理员上创建帐户后发送 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 没有类似的 sendPasswordResetEmail()firebase SDK 可以.我们最终只使用了服务器上的 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天全站免登陆