I'm writing a single-page application in AngularJS that needs to know, whether user is logged-in before running any routes at all.
I'm using Django backend, which supports anonymous sessions, so just looking at cookies I can't figure, if user is logged-in or anonymous. So, to find that out I want to make an Ajax request to backend in Angular application-global .run() and delay any execution of angular application until that request finishes.
How do I do that?
resolveas a last resort solution. Unfortunately, with this approach I'd have to manually call the sameresolvecode at every route, which is repetitive and error-prone. Checking out$httpinterceptors. Thanks for suggestion.