我一直在查看firebase-admin SDK 檔案和討論組,但找不到任何提示來使用我的域服務器端生成 signInWithEmailLink。
是否可以使用我的域在服務器端自定義登錄鏈接?或者它只是可能在客戶端應用程式中?
使用您的身份提供商更新回呼 URL,以使用您的自定義域而不是默認域。例如,將https://myproject.firebaseapp.com/__/auth/handler更改為https://auth.mycustomdomain.com/__/auth/handler。
這是我的實際作業,但我更喜歡最干凈的解決方案。
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);
}
uj5u.com熱心網友回復:
轉到模板頁面,單擊編輯,然后單擊“自定義域”。
這樣做的好處在于它不僅會影響 Firebase 管理員。
轉載請註明出處,本文鏈接:https://www.uj5u.com/net/497487.html
