0

Following the docs for Authenticate with Firebase Using Email Link in JavaScript, I have node running locally in windows. I am able to login with email and password fine, however the email link method is failing. I have this config:

const actionCodeSettings = {
    url: 'http://localhost:5173/',
    // This must be true.
    handleCodeInApp: true,
    iOS: {
        bundleId: 'com.example.ios'
    },
    android: {
        packageName: 'com.example.android',
        installApp: true,
        minimumVersion: '12'
    },
        dynamicLinkDomain: 'localhost'
    };

and

sendSignInLinkToEmail(auth, email, actionCodeSettings)
     .then(() => {
         window.localStorage.setItem('emailForSignIn', email);
     })
     .catch((error) => {
         const errorCode = error.code;
         console.error(error.code);
         const errorMessage = error.message;
         setText(error.message);
     });

localhost is listed in Authorised domains yet still getting error: invalid-dynamic-link-domain

I have tried changing both url and dynamicLinkDomain in actionCodeSettings, arbitrarily to different domains. Not sure what is causing the issue here.

EDIT: I have tried the following:

const actionCodeSettings = {
    url: 'http://localhost:5173/',
    // This must be true.
    handleCodeInApp: true,
    };

Which will send the email, although the link URL is a .firebaseapp.com domain. I have also seen this example on YouTube, although I can't see how mine differs.

1 Answer 1

1

Found! URL used in emails is set from the console.

Authentication -> Templates -> Edit Template -> Customise Action URL.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.