premchandrasingh / angular-interceptor

Much beloved incerceptor for refreshing expired token without interupting API calls

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

AngularInterceptor

This project was generated with Angular CLI version 1.5.0.

Target Understanding of this project

This POC project is to understand the auto refreshing of token when current token is found expired during the course of UI making API calls without breaking the continuity the API call

Note:-
Login and just notice that token life count down. Open the developer tool bar and notice the api calls when token life count down reached 0.

Development server

Run npm start instead of ng serve for both UI server and API server.

Note:- 
The response in this API will never return an http error instead actual error will be wrapped in the API response like

{"status":401,"message":"Expired or invalid token."}

About

Much beloved incerceptor for refreshing expired token without interupting API calls


Languages

Language:TypeScript 60.7%Language:JavaScript 19.6%Language:HTML 19.2%Language:CSS 0.5%