@@ -11,7 +11,7 @@ describe('verify', function() {
11
11
var priv = fs . readFileSync ( path . join ( __dirname , 'priv.pem' ) ) ;
12
12
13
13
it ( 'should first assume JSON claim set' , function ( done ) {
14
- var header = { alg : 'RS256' } ;
14
+ var header = { typ : 'JWT' , alg : 'RS256' } ;
15
15
var payload = { iat : Math . floor ( Date . now ( ) / 1000 ) } ;
16
16
17
17
var signed = jws . sign ( {
@@ -21,15 +21,15 @@ describe('verify', function() {
21
21
encoding : 'utf8'
22
22
} ) ;
23
23
24
- jwt . verify ( signed , pub , { typ : 'JWT' } , function ( err , p ) {
24
+ jwt . verify ( signed , pub , function ( err , p ) {
25
25
assert . isNull ( err ) ;
26
26
assert . deepEqual ( p , payload ) ;
27
27
done ( ) ;
28
28
} ) ;
29
29
} ) ;
30
30
31
31
it ( 'should be able to validate unsigned token' , function ( done ) {
32
- var header = { alg : 'none' } ;
32
+ var header = { typ : 'JWT' , alg : 'none' } ;
33
33
var payload = { iat : Math . floor ( Date . now ( ) / 1000 ) } ;
34
34
35
35
var signed = jws . sign ( {
@@ -39,7 +39,7 @@ describe('verify', function() {
39
39
encoding : 'utf8'
40
40
} ) ;
41
41
42
- jwt . verify ( signed , null , { typ : 'JWT' } , function ( err , p ) {
42
+ jwt . verify ( signed , null , function ( err , p ) {
43
43
assert . isNull ( err ) ;
44
44
assert . deepEqual ( p , payload ) ;
45
45
done ( ) ;
@@ -93,7 +93,7 @@ describe('verify', function() {
93
93
94
94
it ( 'should not error on expired token within clockTolerance interval' , function ( done ) {
95
95
clock = sinon . useFakeTimers ( 1437018584000 ) ;
96
- var options = { algorithms : [ 'HS256' ] , clockTolerance : 100 }
96
+ var options = { algorithms : [ 'HS256' ] , clockTolerance : 100 } ;
97
97
98
98
jwt . verify ( token , key , options , function ( err , p ) {
99
99
assert . isNull ( err ) ;
0 commit comments