HTTP Auth Interceptor Module for Angular 1.4+
This will :
- intercept all the requests done in the app before your user logs in
- broadcasts a message upon reception of a 401 response
- after login is confirmed, will receive a broadcast and retry the previously pending requests
- allows you to configure $http for the next requests in your app (for example, you can add a header, like a token for your API)
Usage
Register this module in your app :
var app = angular;
And then in your user service :
app