以下是一个简单的场景:
我想将 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