删除用户无效
Removing a user is not working
我正试图删除angularfire项目中的一个用户。电子邮件和密码可以正确传递,但由于某些原因,此方法无法执行。以下是我的身份验证服务中的代码(我添加了一些解释性注释):
removeUser: function (email, password) {
console.log(email); --> Correct Email
console.log(password); --> Correct password
auth.$removeUser(email, password, function (succes, error) {
console.log('in removeUser'); --> Does not print
if (!error) {
console.log('user deleted'); --> Also doesn't print
} else {
console.log(error); --> You guessed it, doesn't print
}
});
console.log('Why am I even here?'); --> Does print
}
auth变量是正确的,我没有收到任何错误。
这就是我获取angularfire ref的方式,其他方法,如$createUser和$login都能正常工作:
var ref = new Firebase(FIREBASE_URL);
var auth = $firebaseSimpleLogin(ref);
编辑#2:我注意到resetpassword确实有效,但回调没有发生。有人知道为什么吗?无论我输入的是错误的还是正确的旧密码,它都不会打印任何
resetpassword: function (email, oldPassword, newPassword) {
return auth.$changePassword(email, oldPassword, newPassword, function (error) {
console.log('in resetpass auth'); //doesn't print, no errors
if (!error) {
console.log('Password changed succesfully');
} else {
console.log(error);
}
});
}
当直接使用Firebase Simple Login时,上面引用的方法接受回调作为最终参数。然而,当通过AngularFire使用Firebase+AngularJS时,这些方法被包装为对Angular开发更友好,并返回promise而不是接受的回调。
请参阅https://www.firebase.com/docs/angular/reference.html#changepassword-有关更多详细信息,请发送电子邮件至oldpassword newpassword。
相关文章:
- 从远程脚本获取用户IP
- Facebook JavaScript SDK 检查用户是否为粉丝(错误:指定的版本无效)
- 用户可以在AngularUI日期选择器中键入无效的日期
- 如何检测用户何时在Google Places字段中输入无效位置
- 角度验证:如果用户输入无效的电子邮件或密码,则限制服务器请求
- onblur事件不'如果用户在文本字段中输入值并直接按下浏览器刷新按钮,则无效
- 当用户更改其系统日期时,由于SSL证书无效,JS无法工作
- 使用RegExp进行数字验证,以防止无效的用户输入
- Angular验证——向用户输出无效的字段名
- 当用户以javascript上传无效文件时,清除输入文件字段
- 如何防止用户在输入字段中输入无效字符
- ASP.Net MVC Razor引擎:让javascript函数知道用户是否输入了无效数据
- 对于用户提交的无效数据,适当的HTTP响应是什么?
- 用户登录时总是显示“密码无效”;在MEAN中出现错误
- 删除用户无效
- 如何防止用户在输入的值无效时离开控件
- 在用户输入无效值后显示验证消息,然后将焦点放在keyup上,使用淘汰验证
- jQuery validate插件:重定向用户,如果任何特定条件无效
- 如何知道用户是否输入了无效的$routeparams
- 重复无效的用户输入,直到它有效为止(伪)