I am having trouble resetting my password in my angularjs App. I am utilizing Parse (js SDK) as the backend. Even though I am following the documentation and using Parse.User.requestPasswordReset, I keep encountering error 125 which states invalid email address.
This is the html form I am using :
<input type="email" ng-model="resetData.email" required>
<button ng-click="resetPassword(resetData)">
Ok
</button>
Here is the controller :
app.controller('userCtrl', function($scope, loginService){
$scope.resetPassword = function(resetData){
loginService.resetPassword(resetData,$scope);
};
});
And here is the factory :
app.factory('loginService', function(){
return{
resetPassword:function(resetData,scope){
console.log(resetData.email);
Parse.User.requestPasswordReset(resetData.email,{
success:function(){
alert('You'll receive an email to reset your password');
},
error:function(error){
if (error.code === 205) {
scope.msg_erreur='User not found';
console.log("error "+error.code+" "+error.message);
}
else{
scope.msg_erreur='Oops ! Something wrong happened';
console.log("error "+error.code+" "+error.message);
};
}
})
}
}
});
Some important information to consider :
- The console.log(resetData.email) shows the correct email address.
- The email addresses I used actually exist in the User Class (if not, there is an "error 205 user not found")
- I attempted to hard code an email address directly in the Parse.User.requestPasswordReset instead of using resetData.email
- I tried multiple valid email addresses.
However, I always encounter error 125 indicating an invalid email address.
If anyone has any insights or suggestions, it would be greatly appreciated.
Thank you!