generators/app/templates/client/app/components/auth(auth)/authinterceptor.service.js
function responseError(response) {
      if (response.status === 401) {
        // remove any stale tokens
        $cookieStore.remove('token');

        // use timeout to perform location change
        // in the next digest cycle
        $timeout(function () {
          $location.path('/login');
        }, 0);

        return $q.reject(response);
      }
      return $q.reject(response);
    }
function responseError(response) {
      if (response.status === 401) {
        // remove any stale tokens
        $cookieStore.remove('token');

        // use timeout to perform location change
        // in the next digest cycle
        $timeout(function () {
          $location.path('/login');
        }, 0);

        return $q.reject(response);
      }
      return $q.reject(response);
    }
function responseError ( response ) { if ( response . status === 401 ) { // remove any stale tokens $cookieStore . remove ( 'token' ) ; // use timeout to perform location change // in the next digest cycle $timeout ( function ( ) { $location . path ( '/login' ) ; } , 0 ) ; return $q . reject ( response ) ; } return $q . reject ( response ) ; }
Intercept 401s and redirect you to login
Intercept 401s and redirect you to login