2 ms·
Read a little further in the README. var token = jwt.sign({ foo: 'bar' }, 'shhhhh'); var decoded = jwt.verify(token, 'shhhhh'); console.log(decoded.foo)
by mwpmaybe 10y ago
Read a little further in the README.
var token = jwt.sign({ foo: 'bar' }, 'shhhhh');
var decoded = jwt.verify(token, 'shhhhh');
console.log(decoded.foo) // bar
var decoded_unverified = jwt.decode(token); // NOTE: no secret!
console.log(decoded_unverified.foo) // bar