🚀 Big News: Socket Acquires Coana to Bring Reachability Analysis to Every Appsec Team.Learn more
Socket
Book a DemoInstallSign in
Socket

jwt-js

Package Overview
Dependencies
Maintainers
1
Versions
15
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

jwt-js - npm Package Compare versions

Comparing version

to
0.3.3

1

lib/signer.js

@@ -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'

2

package.json
{
"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')
})