我是http触发器的新手。我正在使用Firestore开发一个管理网站。现在,我想要的是,如果管理员想使用以下代码从Firebase身份验证中删除用户。
admin.auth().deleteUser(uid)
.then(function() {
console.log("Successfully deleted user");
})
.catch(function(error) {
console.log("Error deleting user:", error);
});
为此,我们需要管理员。我们可以通过下面的行获取管理员。我们必须在Node.js(函数)中编写以上代码。
const admin = require('firebase-admin');
现在我的html页面设计是,我在html页面中有一个按钮。当我按下该按钮时,我可以获得相关的用户uid。现在我的问题是如何将该uid发送到server(node.js)并执行删除操作。我对此一无所知。