sun*_*ong 7 node.js firebase firebase-authentication google-cloud-functions
我的目标是使用 Firebase 功能和身份验证为注册用户发送电子邮件。我遵循了Firebase 示例。但它告诉下面的错误消息。
未为当前项目配置或授权提供的动态链接域
我的代码在下面。
const actionCodeSettings = {
url: 'https://www.example.com/finishSignUp?cartId=1234',
handleCodeInApp: true,
iOS: {
bundleId: 'com.example.ios'
},
android: {
packageName: 'com.example.android',
installApp: true,
minimumVersion: '12'
},
dynamicLinkDomain: 'example.page.link'
};
exports.sendmail = functions.https.onRequest((req, res) => {
return cors(req, res, () => {
firebase.auth().sendSignInLinkToEmail("sungyong@humminglab.io", actionCodeSettings)
.then((userCredential) => {
res.status(200).send(userCredential);
res.status(200).send(userCredential);
return;
})
.catch(error => {
// Handle Errors here.
var errorCode = error.code;
var errorMessage = error.message;
console.log(error)
// ...
res.status(400).send(error);
});
});
});
Run Code Online (Sandbox Code Playgroud)
这是我在控制台上的配置。
boj*_*eil 11
example.page.link 未配置为项目的动态链接域。
您需要使用您拥有的一个。您可以从 Firebase 控制台左侧菜单中“增长”下的“动态链接”中获取该信息。
如果您不需要对移动流使用动态链接,只需更改为:
const actionCodeSettings = {
// Replace this URL with the URL where the user will complete sign-in.
url: 'https://www.example.com/finishSignUp?cartId=1234',
handleCodeInApp: true
};
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
3582 次 |
| 最近记录: |