title: Log out from restricted area without triggering security settings
body: <p>I have a section that requires login and a certain role ("higher than 19"). Whenever I logout from it, I get</p>
  
  <pre><code>Error: permission_denied: Client doesn't have permission to access the desired data.
  </code></pre>
  
  <p>Reason for this are my security settings:</p>
  
  <pre><code>".read": "root.child('users').child(auth.uid).child('data').child('role').val() &gt; 19",
  </code></pre>
  
  <p>My logout function:</p>
  
  <pre><code>// Sign out functionality
  App.controller('SignOutCtrl', function($scope, $state, Auth) {
  
      $scope.logout = function() {
  
          // Go to landing page
          $state.go('home');
  
          // Log user out
          Auth.$unauth();
  
      };
  });
  
  
  App.factory('Auth', ['$firebaseAuth', function($firebaseAuth) {
  
      var firebase = new Firebase('https://mysite.firebaseio.com/');
  
      return $firebaseAuth(firebase);
  
  }]);
  </code></pre>
  
  <p>The $state 'home' doesn't have any reading restrictions, looks like the log out actually happens before I'm being redirected to the 'home'-$state, which triggers the security restrictions.</p>
  
  <p>I guess I'm struggling to understand the very basic concept of how to log out from a restricted site without triggering the security setting, can anyone please explain me how to do that properly?</p>