大佬教程收集整理的这篇文章主要介绍了angularjs – 一旦密码重置,Firebase Auth不会更新,大佬教程大佬觉得挺不错的,现在分享给大家,也给大家做个参考。
我在auth.password.istemporarypassword中寻找bool true值,强制用户重置密码.一旦用户执行了此过程并重置,则auth.password.istemporarypassword保持为true.
登录:
var ref = new Firebase(environment); $firebaseAuth(ref) .$authWithpassword({ email: email,password: password },sessionObj) .then(function(authData) { if (password.istemporarypassword === truE) { $state.go('resetpassword'); } }) .catch(function(error) { deferred.reject(error); });
重设密码:
$scope.reset.oldpassword = "oldPass"; $scope.reset.newpassword = "newPass"; $scope.reset.email = "usermail"; ref.changepassword($scope.reset,function(err) { if(err) { ... } else { $state.go('home') } })
ref.onAuth(function(authData) { //user authenticated & needs to change her password if(authData && authData.password.istemporarypassword) { $state.go('resetpassword'); } //else user is logged in with valid password else if(authData) { } //else user is logged out else { } });
以上是大佬教程为你收集整理的angularjs – 一旦密码重置,Firebase Auth不会更新全部内容,希望文章能够帮你解决angularjs – 一旦密码重置,Firebase Auth不会更新所遇到的程序开发问题。
如果觉得大佬教程网站内容还不错,欢迎将大佬教程推荐给程序员好友。
本图文内容来源于网友网络收集整理提供,作为学习参考使用,版权属于原作者。
如您有任何意见或建议可联系处理。小编QQ:384754419,请注明来意。