【发布时间】:2020-09-30 02:01:47
【问题描述】:
我在 Firebase 函数中成功删除了具有帐户 UID 的帐户,但是否可以通过电子邮件地址而不是其 UID 删除经过身份验证的帐户?
这就是我现在拥有的:
admin.auth().getUserByEmail(userEmail).then(function(userRecord) {
// See the UserRecord reference doc for the conteenter code herents of userRecord.
console.log('Successfully fetched user data:', userRecord.toJSON());
admin.auth().deleteUser(userRecord)
.then(function
() {
console.log('This is the ID being used!', userRecord);
console.log('Successfully deleted user');
})
.catch(function(error) {
console.log('This is the ID being used!', userRecord);
console.log('Error deleting user:', error);
});
})
.catch(function(error) {
console.log('Error fetching user data:', error);
});
});
谢谢!
【问题讨论】:
标签: node.js firebase firebase-authentication firebase-admin