使用 Angular2/Ionic2 删除 Firebase 用户
Delete Firebase Users with Angular2/Ionic2
我正在使用 Ionic2/Angular2,并且一直在寻找如何从 Firebase 中删除用户的示例。
如果有人有任何例子,请你帮忙?
谢谢
我有两种选择供您选择:
下拉到原生 Firebase SDK
如中,您可以按照中的步骤获取当前用户,并将其删除。
这将允许您按照以下方式做一些事情,from the docs:
var user = firebase.auth().currentUser;
user.delete().then(function() {
// User deleted.
}, function(error) {
// An error happened.
});
试试这个片段
使用 AngularFire2,how about this approach?
af.auth
.first()
.subscribe(authState => {
console.log(authState);
authState.auth.delete()
.then(_ => console.log('deleted!'))
.catch(e => console.error(e))
});
别忘了 .first()
我正在使用 Ionic2/Angular2,并且一直在寻找如何从 Firebase 中删除用户的示例。
如果有人有任何例子,请你帮忙?
谢谢
我有两种选择供您选择:
下拉到原生 Firebase SDK
如中,您可以按照
这将允许您按照以下方式做一些事情,from the docs:
var user = firebase.auth().currentUser;
user.delete().then(function() {
// User deleted.
}, function(error) {
// An error happened.
});
试试这个片段
使用 AngularFire2,how about this approach?
af.auth
.first()
.subscribe(authState => {
console.log(authState);
authState.auth.delete()
.then(_ => console.log('deleted!'))
.catch(e => console.error(e))
});
别忘了 .first()