Quantcast
Channel: Ionic Forum - Latest posts
Viewing all articles
Browse latest Browse all 228595

Ionic Reset Password with Firebase is not working

$
0
0

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.


Viewing all articles
Browse latest Browse all 228595

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>