mirror of
https://github.com/hanzoai/node-jsonwebtoken.git
synced 2026-09-24 17:00:48 +00:00
Notable changes: 1. `expiresInMinutes` and `expiresInSeconds` are deprecated and no longer supported. 2. `notBeforeInMinutes` and `notBeforeInSeconds` are deprecated and no longer supported. 3. options are properly validated. 4. `options.expiresIn`, `options.notBefore`, `options.audience`, `options.issuer`, `options.subject` and `options.jwtid` are mutually exclusive with `payload.exp`, `payload.nbf`, `payload.aud`, `payload.iss`, `payload.sub` and `payload.jti` respectively. 5. `options.algorithm` is properly validated. 6. `options.headers` is renamed to `options.header`.
13 lines
376 B
JavaScript
13 lines
376 B
JavaScript
var jwt = require('../index');
|
|
var expect = require('chai').expect;
|
|
|
|
describe('noTimestamp', function() {
|
|
|
|
it('should work with string', function () {
|
|
var token = jwt.sign({foo: 123}, '123', { expiresIn: '5m' , noTimestamp: true });
|
|
var result = jwt.verify(token, '123');
|
|
expect(result.exp).to.be.closeTo(Math.floor(Date.now() / 1000) + (5*60), 0.5);
|
|
});
|
|
|
|
});
|