Comparing version 0.3.2 to 0.3.3
@@ -11,3 +11,2 @@ 'use strict' | ||
} | ||
if (typeof signingAlgorithm !== 'string') { | ||
@@ -14,0 +13,0 @@ throw 'signing algorithm parameter must be a string' |
@@ -11,3 +11,2 @@ 'use strict' | ||
} | ||
if (typeof signingAlgorithm !== 'string') { | ||
@@ -14,0 +13,0 @@ throw 'signing algorithm parameter must be a string' |
{ | ||
"name": "jwt-js", | ||
"version": "0.3.2", | ||
"version": "0.3.3", | ||
"description": "node.js library for encoding, decoding, and verifying JSON Web Tokens (JWTs)", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -68,9 +68,15 @@ 'use strict' | ||
test('tokenSigner', function(t) { | ||
t.plan(3) | ||
t.plan(5) | ||
var tokenSigner = new TokenSigner('ES256k', rawPrivateKey) | ||
t.ok(tokenSigner, 'token signer should have been created') | ||
var token = tokenSigner.sign(sampleDecodedToken.payload) | ||
t.ok(token, 'token should have been created') | ||
t.equal(typeof token, 'string', 'token should be a string') | ||
var decodedToken = decodeToken(token) | ||
t.equal(JSON.stringify(decodedToken.header), JSON.stringify(sampleDecodedToken.header), 'decodedToken header should match the reference header') | ||
t.equal(JSON.stringify(decodedToken.payload), JSON.stringify(sampleDecodedToken.payload), 'decodedToken payload should match the reference payload') | ||
}) | ||
@@ -83,4 +89,5 @@ | ||
t.ok(tokenVerifier, 'token verifier should have been created') | ||
var verified = tokenVerifier.verify(sampleToken) | ||
t.equal(verified, true, 'token should have been verified') | ||
}) |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
17822
283