简体   繁体   English

Firebase email 验证甚至在点击链接之前自动发生

[英]Firebase email verification happens automatically even before clicking the link

I've been facing a weird behaviour while implementing the email verification through Firebase .在通过Firebase实施 email 验证时,我遇到了一个奇怪的行为。 After creating an account through an Android app, I send an email verification for the user.通过 Android 应用程序创建帐户后,我为用户发送了 email 验证。

The email is being sent properly but it gets verified automatically even before clicking on the link (as in firebaseAuth.currentUser.isEmailVerified will return true after that). email 已正确发送,但即使在单击链接之前它也会自动验证(因为在firebaseAuth.currentUser.isEmailVerified之后将返回 true)。 If the user presses on the link afterwards, it will say:如果用户之后点击链接,它会说:

Your request to verify your email has expired or the link has already been used您验证 email 的请求已过期或链接已被使用

This only happens with custom domains though.不过,这只发生在自定义域中。 For example if the user uses a gmail account, everything goes normally.例如,如果用户使用 gmail 帐户,一切正常。

Some more info更多信息

The credentials responsible for the email verification is restricted for HTTP referrers with https://{APP-ID}.firebaseapp.com for the APIs Firebase Dynamic Links API and Identity Toolkit API负责 email 验证的凭据仅限于 HTTP 引荐来源网址https://{APP-ID}.firebaseapp.com用于 API Firebase Dynamic Links API Identity Toolkit API

Any ideas on what might be happening?关于可能发生的事情的任何想法?

Did you previously make an account with that email, verify the email, then delete the account?你之前有没有在那个email上注册账号,验证email,然后删号? I had this same issue, it seems like firebase remembers email verification by email address, not by account. 我有同样的问题,好像 firebase 记得 email 通过 email 地址验证,而不是通过帐户。

This is likely an issue with firebase (albeit a rarer edge case in practical use), but if you're just doing testing, try using another email. 这可能是 firebase 的问题(尽管在实际使用中是一种罕见的边缘情况),但如果您只是在进行测试,请尝试使用另一个 email。

UPDATE : See comment below, it appears to be domain-related更新:请参阅下面的评论,它似乎与域相关

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM