firebase - 如果成功验证,如何修改 Firebase 身份验证响应以包含指向应用程序的链接?
问题描述
我想包含一个指向该应用程序的链接,以便用户在他们的电子邮件得到确认后能够直接登录。firebase 控制台没有显示可以编辑的位置。
firebase 控制台没有显示可以编辑的位置。
伪代码:
您的电子邮件已得到确认。现在请继续登录:添加到应用程序的链接。
解决方案
您必须传递一个继续 URLActionCodeSettings
以将用户重定向回应用程序:
var actionCodeSettings = {
// After email is verified, the user will be give the ability to go back
// to the sign-in page.
url: 'https://www.example.com/login',
handleCodeInApp: false
};
firebase.auth().currentUser.sendemailverification(actionCodeSettings)
.then(function() {
// Verification email sent.
})
.catch(function(error) {
// Error occurred. Inspect error.code.
});
了解更多关于ActionCodeSettings
重定向和传递状态的信息:
https ://firebase.google.com/docs/auth/web/passing-state-in-email-actions
您还可以在此处构建自己的自定义登录页面: https ://firebase.google.com/docs/auth/custom-email-handler
推荐阅读
- linux - 如何使用 Linux 调度程序将 CPU 内核限制为仅 2 个应用程序?
- node-modules - 我可以列出所有依赖于我自己的 yarn 工作区吗?
- memory - Intel-x86:WC、WB和UC Memory的交互
- testcafe - Testcafe:有没有一种方法可以让角色检测到过期的会话?
- html - 在密码强度计上使用 role=progressbar 时会引起混淆吗?
- mysql - 存储过程数据未填充到表中
- c++ - fseeko 在寻找 EOF 时不会在文件中创建一个洞
- python - 一个变量传递到 jinja 可以有多深?
- pdf - 破折号 plotly + flask = 创建和下载 pdf 文件
- bash - Bash:生成数字字母组合序列的更智能方法?