我正在嘗試發送與 firebase 的身份驗證鏈接。以下是 firebase 文檔中的代碼。export const CODE_SETTINGS = { // URL you want to redirect back to. The domain (www.example.com) for this // URL must be in the authorized domains list in the Firebase Console. url: 'http://localhost:3000/finishedSignUp', handleCodeInApp: true,};這是我的郵件發送功能。它接受我需要將電子郵件發送到的電子郵件。export const startEmailAuth = (email: string) => { firebase .auth() .sendSignInLinkToEmail(email, ACTION_CODE_SETTINGS) .then(function(result) { // The link was successfully sent. Inform the user. // Save the email locally so you don't need to ask the user for it again // if they open the link on the same device. window.localStorage.setItem('emailForSignIn', email); // TODO: make a nicer UI here. alert(`Verification email has been sent to ${email}`); }) .catch(function(error) { console.error(error); });};我的問題是,如果我將代碼更改為這樣的內容。export const startEmailAuth = (email: string, location: string) => { firebase ......}我應該將位置放在哪里才能將位置與電子郵件一起發送。
如何在 firebase 身份驗證電子郵件中發送 window.location.pathname
慕仙森
2023-07-20 14:50:05