Firebase 用户将电子邮件操作 URL 验证为自定义 URL [英] Firebase User verify Email Action URL to Custom URL

查看:28
本文介绍了Firebase 用户将电子邮件操作 URL 验证为自定义 URL的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用 Angular 和 AngularFire 开发应用程序.当用户使用电子邮件和密码注册并且用户在其电子邮件中收到验证电子邮件时.当我将电子邮件地址验证模板中的操作 URL 更改为 "http://localhost:4200/verify-email-address" 那么用户的电子邮件验证仍然是假的,如果我使用默认的 URL 那么它返回真.如何设置自定义本地模板以向用户显示他/她的电子邮件已验证并重定向该用户以再次登录.

I am developing an application using Angular and AngularFire. When A user is registering using email and password and the user is getting an verification email in his email. When I am changing that Action URL in Email address verification template to "http://localhost:4200/verify-email-address" then the user's email verified is still false, if I use the default URL then it is returning true. How can I set a custom Local template to show a user that his/her email is verified and redirect that user to login again.

推荐答案

自定义电子邮件操作处理需要的不仅仅是更改 URL.您实际上是在接管 Firebase 通常所做的一切,并且需要在此处理过程中的不同位置调用相关的 Firebase API(例如 auth.applyActionCode(actionCode) 以验证电子邮件地址).

Customizing the email action handling requires more than just changing the URL. You're essentially taking over everything that Firebase normally does, and will need to call the relevant Firebase API (e.g. auth.applyActionCode(actionCode) to verify the email address) in various places during this processing.

Firebase 文档在此处中描述了完整过程.您通常希望从该页面复制 HTML + 脚本,使其正常工作,然后仅进行任何自定义.

The full process is described in the Firebase documentation here. You'll typically want to copy the HTML + script from that page, get it working, and only make any customizations after that.

这篇关于Firebase 用户将电子邮件操作 URL 验证为自定义 URL的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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