admin管理员组

文章数量:1291009

I'm trying to implement firebase's email link auth on a web app and I'm having some trouble understanding what the problem here is.

I've followed their instructions on the page to send the email and it's sending, but the problem is the URL being sent is an invalid one.

async sendAuthEmail(email) {
  var actionCodeSettings = {
    // URL you want to redirect back to. The domain (www.example) for this
    // URL must be whitelisted in the Firebase Console.
    url: "http://localhost:3000",
    // This must be true.
    handleCodeInApp: true,
    iOS: {
      bundleId: ".example.ios"
    },
    android: {
      packageName: ".example.android",
      installApp: true,
      minimumVersion: "12"
    }
  };

  return await firebase
    .auth()
    .sendSignInLinkToEmail(email, actionCodeSettings);
}

And the URL being sent is (I changed my firebaseapp name):

https://?link=://localhost:3000&apn=.example.android&amv=12&ibi=.example.ios&ifl=://localhost:3000

I also tried changing the url parameter but it fails anyway.

Any ideas that can be shared?

Thanks!

I'm trying to implement firebase's email link auth on a web app and I'm having some trouble understanding what the problem here is.

I've followed their instructions on the page to send the email and it's sending, but the problem is the URL being sent is an invalid one.

async sendAuthEmail(email) {
  var actionCodeSettings = {
    // URL you want to redirect back to. The domain (www.example.) for this
    // URL must be whitelisted in the Firebase Console.
    url: "http://localhost:3000",
    // This must be true.
    handleCodeInApp: true,
    iOS: {
      bundleId: ".example.ios"
    },
    android: {
      packageName: ".example.android",
      installApp: true,
      minimumVersion: "12"
    }
  };

  return await firebase
    .auth()
    .sendSignInLinkToEmail(email, actionCodeSettings);
}

And the URL being sent is (I changed my firebaseapp name):

https://?link=https://myfirebasedbname.firebaseapp./__/auth/action?apiKey%3DAIzaSyDSio7vAbW7O0TVGCF2UpG7FsQDvHX0M7Q%26mode%3DsignIn%26oobCode%3DXoAsz5CoIJOhdhAcJpC2E3iWI8fmyTwJPIUmMlgLvakAAAFiy0Wm9A%26continueUrl%3Dhttp://localhost:3000&apn=.example.android&amv=12&ibi=.example.ios&ifl=https://myfirebasedbname.firebaseapp./__/auth/action?apiKey%3DAIzaSyDSio7vAbW7O0TVGCF2UpG7FsQDvHX0M7Q%26mode%3DsignIn%26oobCode%3DXoAsz5CoIJOhdhAcJpC2E3iWI8fmyTwJPIUmMlgLvakAAAFiy0Wm9A%26continueUrl%3Dhttp://localhost:3000

I also tried changing the url parameter but it fails anyway.

Any ideas that can be shared?

Thanks!

Share Improve this question edited Apr 16, 2018 at 14:03 Filipe Picoito asked Apr 15, 2018 at 21:57 Filipe PicoitoFilipe Picoito 6951 gold badge6 silver badges27 bronze badges
Add a ment  | 

1 Answer 1

Reset to default 9

Have you configured your Firebase Dynamic Link domain? You need to do that in the dynamic links section of the Firebase Console.

If you are only using this for a web only app, you don' t need to include the android or ios fields in the ActionCodeSettings object. This avoids the need to setup FDL:

var actionCodeSettings = {
  url: "http://localhost:3000",
  // This must be true.
  handleCodeInApp: true
};

本文标签: javascriptsendSignInLinkToEmail sending invalid URLStack Overflow