我正在尝试发送与 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 ......
}
我应该将位置放在哪里才能将位置与电子邮件一起发送。
犯罪嫌疑人X
相关分类