管理软件开发工具包现在有一些方法可以让你做这个精确的事情。查看上的文档
email action links
尤其是
生成密码重置电子邮件链接
“剖面图。
// Admin SDK API to generate the password reset link.
const email = 'user@example.com';
admin.auth().generatePasswordResetLink(email, actionCodeSettings)
.then((link) => {
// Do stuff with link here
})
.catch((error) => {
// Some error occurred.
});
完全公开-我实际上没有使用任何这些功能,我有点担心,有问题的页面涉及很多移动应用程序-所以你
可以
必须通过移动应用程序配置。
const actionCodeSettings = {
// URL you want to redirect back to. The domain (www.example.com) for
// this URL must be whitelisted in the Firebase Console.
url: 'https://www.example.com/checkout?cartId=1234',
// This must be true for email link sign-in.
handleCodeInApp: true,
iOS: {
bundleId: 'com.example.ios'
},
android: {
packageName: 'com.example.android',
installApp: true,
minimumVersion: '12'
},
// FDL custom domain.
dynamicLinkDomain: 'coolapp.page.link'
};
另一方面,该页面还表示,这些功能提供了以下功能:
能够通过手机自定义链接的打开方式
应用程序或浏览器,以及如何传递附加状态信息等。
这听起来很有希望,允许它在浏览器中打开…但是如果你是为网络开发的——如果没有提供iOS/android信息,功能就会出错……那么恐怕你得做
old fashioned approach
并创建自己的实现…但我倾向于这个
.generatePasswordResetLink
应该为你工作。