简体   繁体   English

firebase-admin SDK中的自定义authDomain?

[英]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.

相关问题 如何使用 Node.js 和“firebase-admin”SDK 查询 Firebase? - How to query Firebase with Node.js and "firebase-admin" SDK? 节点 Lambda 超时 firebase-admin SDK - Node Lambda timing out firebase-admin SDK 使用 Nuxt 的 Firebase 管理员 - Firebase-Admin with Nuxt 无法在 node.js admin sdk 中使用 firebase documentId()(firebase-admin npm package 语法问题) - Unable to use firebase documentId() in node js admin sdk (firebase-admin npm package grammar issue) firebase JS SDK 包是否与云函数的 Node.js 环境兼容? 为什么要使用 firebase-admin? - Is the firebase JS SDK package compatible with the Node.js environment of a cloud function? Why use firebase-admin? firebase-admin WebSocket错误 - firebase-admin WebSocket Error firebase-admin节点SDK:为什么admin.database既是函数又是属性? - firebase-admin node sdk: Why admin.database is both a function and property? Firebase-admin Firestore node.js 与模块化 v9 js sdk 共享逻辑 - Firebase-admin Firestore node.js share logic with modular v9 js sdk nodejs firebase-admin sdk:如果我只使用VerifyIdToken,我可以删除数据库文件夹吗? - nodejs firebase-admin sdk: Can I remove Database folder if I'm only using VerifyIdToken? Firebase管理员处理多种环境 - Firebase-admin deal with multiple environments
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM