【问题标题】:Firebase dynamic links to reset password : not configured for the current project用于重置密码的 Firebase 动态链接:未为当前项目配置
【发布时间】:2021-11-05 15:42:59
【问题描述】:

我正在使用云函数通过 admin sdk 生成密码重置链接。

我需要在我的网站而不是我的移动应用中处理操作链接。

我的操作代码设置如下:

ActionCodeSettings codeSettings = ActionCodeSettings(
        url: "https://example.com/links/reset",
      handleCodeInApp: false,
      dynamicLinkDomain: "https://example.com/links"
    );

我也试过了:

ActionCodeSettings codeSettings = ActionCodeSettings(
        url: "https://example.com/links/reset",
      handleCodeInApp: false,
    );

两者都给我以下错误:

FirebaseAuthError: The provided dynamic link domain is not configured or authorized for the current project.

我只是在 onCall 对我的函数的 https 请求中使用 : admin.auth().generatePasswordResetLink(data.email, actionCodeSettings) 方法。

我当然已经为我的项目设置了动态链接,并且我的项目使用Firebase Hosting 托管。

我也将此添加到我的firebase.json 文件中:

"rewrites": [ {
  "source": "/links/**", 
  "dynamicLinks": true
} ]

documentation中所述。

我做错了什么?

【问题讨论】:

    标签: firebase flutter google-cloud-functions firebase-dynamic-links


    【解决方案1】:

    如果我从颤振中生成ActionCodeSettings 它不起作用。

    但是,如果在我的 NodeJS 代码中实现:

    const actionCodeSettings = {
        url: "https://example.com/links",
        handleCodeInApp: false
      };
    

    它正在工作。

    在日志中我可以看到参数 dynamicLinkDomain 被设置为 null 并通过了,即使我没有使用它。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2019-08-29
      • 2023-02-17
      • 1970-01-01
      • 2016-11-04
      • 2020-04-25
      • 1970-01-01
      • 2018-12-24
      • 2014-04-07
      相关资源
      最近更新 更多