Question: how to check whether my token is expired or not?

```
var token = jwt.sign(user,app.get('superSecret'),{
    expiresIn : 2
});

```

Answer: 
```
var isExpiredToken = false;

var dateNow = new Date();

if(decodedToken.exp < dateNow.getTime())

{
       isExpiredToken = true;
}

```
The best way set the code in your parent component of page or wrapper.
Your need delete your old (expared) token.

```
 let token = localStorage.getItem( 'token' );

 jwt.verify( token, 'yourkey', function(err, decoded) {

    if ( err ) {

    localStorage.removeItem( 'token' );

    }

  } );

```