Home > front end >  Custom authDomain in firebase-admin SDK?
Custom authDomain in firebase-admin SDK?

Time:06-29

I have been looking to the firebase-admin SDK documentation and the discussions groups and can not find any tips to generate a signInWithEmailLink with my domain server-side.

Is it possible to custom the signIn link in server-side with my domain? Or is it just possible in client app?

Update the Callback URL with your identity provider to use your custom domain instead of the default domain. For example, change https://myproject.firebaseapp.com/__/auth/handler to https://auth.mycustomdomain.com/__/auth/handler.

This is my actual work around but I would prefer a cleanest solution.

let link = await getAuth().generateSignInWithEmailLink(email, actionCodeSettings);

if(link.startsWith("https://myproject.firebaseapp.com")) {
  link = link.replace("https://myproject.firebaseapp.com", process.env.AUTH_URL);
}

CodePudding user response:

Go to the templates page, click edit and then click "customize domain".
The advance of doing so is that it not only affects Firebase admin.

  • Related