密码重设电子邮件和电子邮件验证中的Firebase通过状态(继续到网站链接) [英] Firebase Passing State(continue to website link) in Password Reset Email and email verification

查看:77
本文介绍了密码重设电子邮件和电子邮件验证中的Firebase通过状态(继续到网站链接)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用Firebase在我的网站中进行用户身份验证.尝试建立密码重设流程,使用户收到密码重设电子邮件,重设密码,然后将其重定向到具有给定URL的网站.

I am using firebase for user authentication in my website. Trying to build a password reset flow where the user receives password reset email, reset's their password and then it is just redirect to the website with the given url.

问题:我可以发送密码重置电子邮件并更改该帐户的密码,但是当我单击firebase提供的继续按钮时,它会在浏览器控制台中引发以下错误.

Problem: I am able to send the password reset email and change the password for that account but when I click the continue button provided by the firebase.It throws following error in browser console.

Uncaught DOMException: Failed to execute 'assign' on 'Location': 
'https://?link=http://mywebsite.com/?email%3Duser@example.com' is not a valid URL.

我在电子邮件验证链接上也遇到了同样的错误.

I am also getting the same error for email verification link also.

该网址已在Firebase的授权域中列入白名单.

The url is whitelisted in Firebase's authorized domains.

请帮助我!

推荐答案

您是否将 canHandleCodeInApp 传递为true?这意味着您希望重置链接在移动应用程序(如果已安装)中打开.如果是这样,则好像您的FDL域未配置(正在解析为空字符串).您应该转到Firebase控制台中的动态链接"部分,并设置/同意服务条款.这会将链接更新为以下内容: https://example.app.goo.gl/?link = .... 您将能够在控制台动态链接"部分中看到该域.

Are you passing canHandleCodeInApp as true? This means you want the reset link to open in a mobile app if installed. If so, it looks like your FDL domain is not configured (it is resolving to empty string). You should go to the Dynamic links section in the Firebase Console and setup/agree to terms of service. This will update the link to something like: https://example.app.goo.gl/?link=.... You will be able to see that domain in the Console Dynamic links section.

否则,您可以将 canHandleCodeInApp 设置为false,这将通过Firebase控制台的电子邮件模板部分中设置的网络操作回调URL打开链接.与后者不同,此链接不会通过FDL.

Otherwise you can pass canHandleCodeInApp as false which would open the link via the web action callback URL set up in the email templates section of the Firebase Console. This link will not go through FDL unlike the latter.

这篇关于密码重设电子邮件和电子邮件验证中的Firebase通过状态(继续到网站链接)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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