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.com) for this
// URL must be whitelisted in the Firebase Console.
url: "http://localhost:3000",
// This must be true.
handleCodeInApp: true,
iOS: {
bundleId: "com.example.ios"
},
android: {
packageName: "com.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.com/__/auth/action?apiKey%3DAIzaSyDSio7vAbW7O0TVGCF2UpG7FsQDvHX0M7Q%26mode%3DsignIn%26oobCode%3DXoAsz5CoIJOhdhAcJpC2E3iWI8fmyTwJPIUmMlgLvakAAAFiy0Wm9A%26continueUrl%3Dhttp://localhost:3000&apn=com.example.android&amv=12&ibi=com.example.ios&ifl=https://myfirebasedbname.firebaseapp.com/__/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!
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
};
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With