Firebase logout permission error

1k views Asked by At

When trying to logout out of firebase with unauth() i get an error saying

Error: permission_denied: Client doesn't have permission to access the desired data.

this is my controller:

 .controller('StatusController', [ '$scope', '$state', '$rootScope', '$firebase', '$firebaseObject', 'FIREBASE_URL', 'Authentication', function($scope , $state, $rootScope, $firebase, $firebaseObject, FIREBASE_URL, Authentication) {
      var ref = new Firebase(FIREBASE_URL);  
      $scope.logout = function(){
           $state.go('login');
           Authentication.logout();
      };

 }])

 .factory('Authentication' , ['$firebase' , 'FIREBASE_URL', '$q' , function( $firebase , FIREBASE_URL, $q, $scope){

    // other code above here
    var ref = new Firebase(FIREBASE_URL);

    logout: function(){
        // $scope.destroy();
            window.localStorage.removeItem("firebase:session::outfitpictest");
             return ref.unauth();
         } //logout
     } // object

     return myObject; 
 }]);
0

There are 0 answers