Last active
September 9, 2016 14:32
-
-
Save rbrooks/05a2c428ef3f31221ef79a0942cc8bca to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// First: | |
// npm install jsonwebtoken | |
// https://github.com/auth0/node-jsonwebtoken | |
// | |
// Then launch `node` shell. | |
var jwtLib = require('jsonwebtoken'); | |
var jwtStr = 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJjb250ZXh0Ijoic3N2cHpmYWZoZCIsInN1YiI6InVybjpzd2l0Y2hjb25uZXg6dXNlcjo0MCIsImlzcyI6InVybjpzd2l0Y2hjb25uZXg6c3ZjOmF1dGgiLCJleHAiOjE0NzMzNjMxNTMsImlhdCI6MTQ3MzM2Mjg1MywiYXVkIjoidXJuOnN3aXRjaGNvbm5leDpzdmM6bW9iaWxlIn0.tZj08Vlci3g7SYUm-8MxfH_Ty_1rtBGgUzC311-NSaU'; | |
jwt = jwtLib.decode(jwtStr); | |
if (jwt.exp < Date.now() / 1000) console.log('JWT token is expired.'); | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment