title: AngularJS (Restangular): Making a promise block? Need to use it for validating a token
body: <p>I have stumbled upon Restangular for making calls to a rest service. It works great and returns a promise. I need to be able to have the call block. The reason for this is on a fresh page reload I am technically not loggged in but I may have a token stored in a cookie. i would like to validate this token against a rest service. Problem is that I need it to block.</p>
  
  <p>If a timeout occurs or if its not valid that i can treat teh user as not authenticated.</p>
  
  <p>This is the reason for wanting to block is that i would like to redirect them using $location.path to a new URL it not a valid token.</p>
  
  <p>This doesn't happen on a specific route so i can't use resolve which is blocking. It technically happens on every route - I use the $on.$routeChangeStart and check an internal variable got LoggedIn or not, if not logged in i check for the stored token.</p>
  
  <p>This happens on each Page refresh but not while navigating inside the application.</p>
  
  <p>The affect I am trying to get is how Gmail works.</p>
  
  <p>Look forward to any insight anyone has on this </p>
  
  <p>Thanks</p>