[英]Custom authDomain in firebase-admin SDK?
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.我一直在查看firebase-admin SDK 文档和讨论组,但找不到任何提示来使用我的域服务器端生成 signInWithEmailLink。
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.使用您的身份提供商更新回调 URL,以使用您的自定义域而不是默认域。 For example, change https://myproject.firebaseapp.com/__/auth/handler to https://auth.mycustomdomain.com/__/auth/handler .例如,将https://myproject.firebaseapp.com/__/auth/handler更改为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);
}
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.这样做的好处在于它不仅会影响 Firebase 管理员。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.