I am getting one JWT encoded access token from my API in response. But I am not able to decode it and get it in JSON format. I tried using the angular2-jwt library for it, b
Use @auth0/angular-jwt
Step - 1 : Install using npm
npm install @auth0/angular-jwt
Step - 2 : Import the package
import { JwtHelperService } from '@auth0/angular-jwt';
Step - 3 : Create an instance and use
const helper = new JwtHelperService();
const decodedToken = helper.decodeToken(myRawToken);
// Other functions
const expirationDate = helper.getTokenExpirationDate(myRawToken);
const isExpired = helper.isTokenExpired(myRawToken);