【发布时间】:2017-03-31 03:39:45
【问题描述】:
这是一个简单的场景..
我想将 firebase 文档中给出的这些代码转换为我的 api..
如何将其转换为回调函数?
var uid = "some-uid";
admin.auth().createCustomToken(uid)
.then(function(customToken) {
// Send token back to client
})
.catch(function(error) {
console.log("Error creating custom token:", error);
});
这里是文档的链接..
https://firebase.google.com/docs/auth/admin/create-custom-tokens
【问题讨论】:
-
不要!信守承诺!
-
你使用的是什么 promise 库?
标签: node.js firebase callback promise firebase-authentication