【问题标题】:Firebase Passing State(continue to app link) in Password Reset Email密码重置电子邮件中的 Firebase 传递状态(继续应用链接)
【发布时间】:2018-02-10 22:17:42
【问题描述】:

尝试构建一个密码重置流程,用户在其中收到密码重置电子邮件,重置他们的密码,然后被引导回应用程序。试图避免深度链接,只需打开应用程序备份。

该应用正在使用具有 Firebase 身份验证的最新 Ionic 和 Angular 版本。

问题:我可以发送密码重置电子邮件并更改该帐户的密码,但是当我单击 firebase 提供的继续按钮时,它会在 Android 和 iPhone 上中断。该链接也以 localhost 开头。我不确定我做错了什么,或者我是否配置错误。

当 Firebase 的文档说“Android/iOS 应用需要在控制台中注册”时,它也会感到困惑。

真的没办法了!

我的操作代码设置几乎是默认设置。

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

var actionCodeSettings = {
 url: 'https://www.myapp.com/?email=' + email,
 iOS: {
  bundleId: 'com.myapp.new'
 },
 android: {
  packageName: 'com.myapp.new',
  installApp: true,
  minimumVersion: '2'
 },
 handleCodeInApp: false
};

这是链接的样子

https://localhost/?link=https://myapp.com/?email%3Demail@example.com&apn=com.myapp.new&amv=2&ibi=com.myapp.new&ifl=https://myapp.com/?email%3Demail@example.com

【问题讨论】:

  • 你在哪里测试这个?在devicebrowser
  • 设备,直接从 ionic 命令行构建 ios 并通过 xcode 和 android 运行
  • 你有没有关注任何文章?网址?
  • 是的,一直在关注文档,firebase.google.com/docs/auth/web/…

标签: angular firebase ionic-framework firebase-authentication ionic3


【解决方案1】:

我强烈推荐阅读this article 以了解如何正确使用 Ionic。如果这不是您需要的,请告诉我。

.ts

resetPassword(){
  if (!this.resetPasswordForm.valid){
    console.log(this.resetPasswordForm.value);
  } else {
    this.authProvider.resetPassword(this.resetPasswordForm.value.email)
    .then((user) => {
      let alert = this.alertCtrl.create({
        message: "We just sent you a reset link to your email",
        buttons: [
          {
            text: "Ok",
            role: 'cancel',
            handler: () => { this.navCtrl.pop(); }
          }
        ]
      });
      alert.present();

    }, (error) => {
      var errorMessage: string = error.message;
      let errorAlert = this.alertCtrl.create({
        message: errorMessage,
        buttons: [{ text: "Ok", role: 'cancel' }]
      });
      errorAlert.present();
    });
  }
}

【讨论】:

    【解决方案2】:

    您的 FDL 域似乎未配置。奇怪的是,它正在被localhost 取代。在这种情况下应该返回一个错误。您可以转到动态链接部分并同意 FDL 的条款吗?域应该类似于example.app.goo.gl

    【讨论】:

    • 你是对的,实际的动态链接配置​​不正确!
    猜你喜欢
    • 2018-02-23
    • 2021-01-05
    • 2021-02-05
    • 2018-12-24
    • 1970-01-01
    • 1970-01-01
    • 2016-04-04
    • 1970-01-01
    • 2019-11-28
    相关资源
    最近更新 更多