Hi,
I am using Firebase to manage registered users information with ionic App. I added below code to reset password with email : ng-click="resetPassword() with button.
When I enter to receive reset password link, I cannot able to receive email. Even I configure Reset Password in Firebase Dashbord.
So what is the problem?
Any help would be appreciated.
Are you sending the email in the resetPassword() function?
Yes I am sending email in resetPassword() function. Here is my fuction :
.controller(‘ResetCtrl’, [’$scope’, ‘$state’, ‘$firebaseAuth’, ‘$cordovaOauth’, ‘$ionicLoading’, function($scope, $state, $firebaseAuth, $cordovaOauth,$ionicLoading) {
var fb = new Firebase(“https://myapp.firebaseio.com/”);
var fbAuth = $firebaseAuth(fb);
$scope.login = function() {
$state.go('authentication');
}
$scope.register = function() {
$state.go('signup');
}
$scope.user = {
email: ''
};
$scope.errorMessage = null;
$scope.resetPassword = function() {
$scope.errorMessage = null;
$ionicLoading.show({
template: 'Please wait...'
});
fbAuth.sendPasswordResetEmail($scope.email)
.then(showConfirmation)
.catch(handleError);
};
function showConfirmation() {
$scope.emailSent = true;
$ionicLoading.hide();
};
function handleError(error) {
switch (error.code) {
case 'INVALID_EMAIL':
case 'INVALID_USER':
$scope.errorMessage = 'Invalid email';
break;
default:
$scope.errorMessage = 'Error: [' + error.code + ']';
}
$ionicLoading.hide();
}
}])
But I don’t know why email is not sending.