I came across Restangular for calls to the recreation service. It works great and makes a promise. I need to have a call block. The reason for this is a new page reload. I am technically not registered, but I may have a token stored in a cookie. I would like to confirm this token against the recreation service. The problem is that I need to block.
If a timeout occurs or if it is not valid, I can treat the user as not authenticated.
This is the reason you want to block, because I would like to redirect them using $ location.path to the new URL, this is not a valid token.
This does not happen on a specific route, so I cannot use a resolution that blocks. This technically happens on every route - I use $ on. $ RouteChangeStart and check the internal variable obtained by LoggedIn or not, if not logging in, I check the stored token.
This happens every time the page is refreshed, but not during navigation within the application.
The affect I'm trying to get is how Gmail works.
Look forward to any insight anyone has on this.
thanks
source share