mirror of
https://github.com/hanzoai/node-jsonwebtoken.git
synced 2026-09-24 17:00:48 +00:00
* Introduction of the secret callback Without the more contentious 'none'-changes * Removed some spaces... I should really add a editor.config and eslint to this project ;-) * Removed xtend as a dependency, as the native Object.Assign can do this as well * Removed xtend as a dependency, as the native Object.Assign can do this as well * Resolve feedback from review * Added extra test and fixed the associated bug * The return of the header * Forgot to change this one as well... Sorry bout that * Updated the readme and made the if-statements consistent * Space; The final frontier
10 lines
294 B
JavaScript
10 lines
294 B
JavaScript
var jwt = require('../index');
|
|
|
|
var claims = {"name": "doron", "age": 46};
|
|
jwt.sign(claims, 'secret', {"keyid": "1234"}, function(err, good) {
|
|
console.log(jwt.decode(good, {"complete": true}).header.kid);
|
|
jwt.verify(good, 'secret', function(err, result) {
|
|
console.log(result);
|
|
})
|
|
});
|