Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Firebase Passing State(continue to website link) in Password Reset Email and email verification

I am using firebase for user authentication in my website. Trying to build a password reset flow where the user receives password reset email, reset's their password and then it is just redirect to the website with the given url.

Problem: I am able to send the password reset email and change the password for that account but when I click the continue button provided by the firebase.It throws following error in browser console.

Uncaught DOMException: Failed to execute 'assign' on 'Location': 
'https://?link=http://mywebsite.com/?email%[email protected]' is not a valid URL.

I am also getting the same error for email verification link also.

The url is whitelisted in Firebase's authorized domains.

Please help me!

like image 483
bjkpriyanka Avatar asked Sep 14 '17 06:09

bjkpriyanka


1 Answers

Are you passing canHandleCodeInApp as true? This means you want the reset link to open in a mobile app if installed. If so, it looks like your FDL domain is not configured (it is resolving to empty string). You should go to the Dynamic links section in the Firebase Console and setup/agree to terms of service. This will update the link to something like: https://example.app.goo.gl/?link=.... You will be able to see that domain in the Console Dynamic links section.

Otherwise you can pass canHandleCodeInApp as false which would open the link via the web action callback URL set up in the email templates section of the Firebase Console. This link will not go through FDL unlike the latter.

like image 146
bojeil Avatar answered Oct 02 '22 23:10

bojeil