angular2-jwt.js
function tokenNotExpired(tokenName, jwt) {
    if (tokenName === void 0) { tokenName = AuthConfigConsts.DEFAULT_TOKEN_NAME; }
    var token = jwt || localStorage.getItem(tokenName) || sessionStorage.getItem(tokenName);
    var jwtHelper = new JwtHelper();
    return token != null && !jwtHelper.isTokenExpired(token);
}
function tokenNotExpired(tokenName, jwt) {
    if (tokenName === void 0) { tokenName = AuthConfigConsts.DEFAULT_TOKEN_NAME; }
    var token = jwt || localStorage.getItem(tokenName) || sessionStorage.getItem(tokenName);
    var jwtHelper = new JwtHelper();
    return token != null && !jwtHelper.isTokenExpired(token);
}
function tokenNotExpired ( tokenName , jwt ) { if ( tokenName === void 0 ) { tokenName = AuthConfigConsts . DEFAULT_TOKEN_NAME ; } var token = jwt || localStorage . getItem ( tokenName ) || sessionStorage . getItem ( tokenName ) ; var jwtHelper = new JwtHelper ( ) ; return token != null && ! jwtHelper . isTokenExpired ( token ) ; }
Checks for presence of token and that token hasn't expired.
For use with the @CanActivate router decorator and NgIf
Checks for presence of token and that token hasn t expired . For use with the