首页 > 解决方案 > Firebase 无密码重新身份验证不起作用

问题描述

我在网络反应应用程序中设置了无密码登录。它有效,但更新电子邮件无效。

有效的登录代码

firebase.auth()
      .sendSignInLinkToEmail(email, {
        url: window.location.href,
        handleCodeInApp: true,
      })

重新认证代码抛出错误

credential = firebase.auth.EmailAuthProvider.credentialWithLink(
    window.localStorage.getItem('emailForSignIn'),
    window.location.href
  )

这是导致问题的第二个论点。此步骤是在使用这些凭据调用 reauthenticate 之前。控制台中的错误:

{a: null
code: "auth/argument-error"
message: "Invalid email link!}

即使这是 firebase 文档所说的它不起作用。非常感谢任何帮助。

标签: javascriptfirebasefirebase-authentication

解决方案


推荐阅读