title: Transition Rejection Angular UI Router
body: <p>I have a HTTPInterceptor that should go to signin state whenever a 401 is caught. My problem is that I have 3 asynchronous call to API that almost starts the same time. When all of them returns 401, i got an error with the following message:</p>
  
  <blockquote>
    <p>Transition Rejection($id: 0 type: 6, message: The transition errored, detail: "undefined")</p>
  </blockquote>
  
  <p>This is my code for my interceptor:</p>
  
  <pre><code>switch (response.status) {
    case 401:
      let url = $location.absUrl();
      // This condition supposed to prevent
      // going to signin state again after a response of 401.
      // Not really sure if ui-router will navigate still on the same
      // state. So maybe this condition is not needed?
      if (url.indexOf('sign-in') !== -1) {
        deferred.reject(response.data.error);
      } else {
        if ($transitions._transitionCount === 1) {
          $state.go('signin');
        }
      }
      break;
  </code></pre>
  
  <p>What ive tried so far is to check the transitionCount but still the error persist.</p>
  
  <p>Thanks!</p>