Angularjs and slim framework JWT authentication and token refresh flow Angularjs and slim framework JWT authentication and token refresh flow angularjs angularjs

Angularjs and slim framework JWT authentication and token refresh flow


There is no need to loop token expiration checking. I use https://github.com/auth0/angular-jwt as a library for my Angular projects, which provides a way to refresh token just before the HTTP request is fired, simplifying auth mechanism.

Also, you could remove token from request if its loading a template (ends with .html), but this is just a personal preference.