I'm using auth0/angular2-jwt pakage for handling JWT Token Based authentication in Angular6 Application. if we gave valid token isTokenExpired function always returns false
The below code i have tried:
localStorage.setItem('id_token', response['token']);
const helper = new JwtHelperService();
helper.isTokenExpired(localStorage.getItem('id_token')
And
constructor(
private http: Http,
private helper: JwtHelperService
) {
}
public handleResponse(response: Response){
localStorage.setItem('id_token', response['token']);
console.log(this.helper.isTokenExpired(localStorage.getItem('id_token')));
}
i have tried above two methods its always return false
Thanks in Advance.
The link below might help. Good luck.
https://github.com/auth0/angular2-jwt/issues/334#issuecomment-293968046