mirror of
https://github.com/hanzoai/node-jsonwebtoken.git
synced 2026-09-24 17:00:48 +00:00
* Check payload is not null when decoded. Fixed "Cannot read property 'nbf' of null" * Condition on obj !== null for clarity * Added test for decoding null token
13 lines
283 B
JavaScript
13 lines
283 B
JavaScript
var jwt = require('../index');
|
|
var expect = require('chai').expect;
|
|
var atob = require('atob');
|
|
|
|
describe('decoding', function() {
|
|
|
|
it('should not crash when decoding a null token', function () {
|
|
var decoded = jwt.decode("null");
|
|
expect(decoded).to.equal(null);
|
|
});
|
|
|
|
});
|