title: Satellizer login JWT token is gone when page refresh
body: <p><a href="https://i.stack.imgur.com/C7BiZ.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/C7BiZ.png" alt="enter image description here"></a></p>
  
  <p>I am using the <a href="https://github.com/sahat/satellizer" rel="nofollow noreferrer"><code>Angular-satellizer</code></a> extension for the login/register feature but I am stuck at number 7. </p>
  
  <p>Token was saved to <code>localStorage</code> but I when refresh the page it's gone and <code>$auth.isAuthenticated()</code> function is returning false.</p>
  
  <p><a href="https://i.stack.imgur.com/fL193.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/fL193.png" alt="enter image description here"></a></p>
  
  <pre><code>.controller('loginCtrl', function($scope, $state, $auth, jwtHelper) {
    $scope.login = function() {
      $auth.login($scope.user)
        .then(function(response) {
          var gelenToken = response.data;
          var tokenPayload = jwtHelper.decodeToken(gelenToken.token);
          console.log(JSON.stringify(tokenPayload)); // Output:{"sub":"1","iat":1496346513,"exp":1497556113,"data":{"role":"admin"}}
          localStorage.setItem('token', JSON.stringify(tokenPayload));
          $state.go('baba.manga');
        })
    };
  })
  </code></pre>