I am using angular-jwt to to check whether token is expire or not and while using i am getting this error
Type 'string' | null is not assignable to type 'string'
helper = new JwtHelperService();
var token: string = localStorage.getItem('token');
this.helper.isTokenExpired(token); // this line contains the error
Error
First you should check your token
var token: string = localStorage.getItem('token');
if (token) {
this.helper.isTokenExpired(token);
}