Comparing version 0.1.1 to 0.1.3
@@ -39,3 +39,4 @@ 'use strict'; | ||
if (!profile) return reject(new Error('No profile found, unable to verify JWT')); | ||
var verifier = new _jsontokens.TokenVerifier('ES256K', profile.publicKey); | ||
var publicKey = profile.publicKey.match(/^0x/) ? profile.publicKey.slice(2) : profile.publicKey; | ||
var verifier = new _jsontokens.TokenVerifier('ES256K', publicKey); | ||
if (verifier.verify(jwt)) { | ||
@@ -42,0 +43,0 @@ if (payload.exp && payload.exp <= new Date().getTime()) { |
{ | ||
"name": "uport", | ||
"version": "0.1.1", | ||
"version": "0.1.3", | ||
"description": "Library for interacting with uport profiles and attestations", | ||
@@ -14,3 +14,4 @@ "main": "lib/index.js", | ||
"build:es5": "./node_modules/.bin/babel src -d lib", | ||
"build": "yarn test && yarn build:es5" | ||
"build:browser": "./node_modules/.bin/webpack --config webpack.config.js", | ||
"build": "yarn test && yarn build:es5 && yarn build:browser" | ||
}, | ||
@@ -31,2 +32,3 @@ "author": "Pelle Braendgaard <pelle.braendgaard@consensys.net>", | ||
"babel-jest": "^18.0.0", | ||
"babel-loader": "^6.2.10", | ||
"babel-plugin-syntax-object-rest-spread": "^6.13.0", | ||
@@ -39,4 +41,6 @@ "babel-plugin-transform-object-rest-spread": "^6.22.0", | ||
"jest": "^18.1.0", | ||
"mockdate": "^2.0.1" | ||
"json-loader": "^0.5.4", | ||
"mockdate": "^2.0.1", | ||
"webpack": "^1.14.0" | ||
} | ||
} |
@@ -24,3 +24,4 @@ import { createUnsignedToken, TokenVerifier, decodeToken } from 'jsontokens' | ||
if (!profile) return reject(new Error('No profile found, unable to verify JWT')) | ||
const verifier = new TokenVerifier('ES256K', profile.publicKey) | ||
const publicKey = profile.publicKey.match(/^0x/) ? profile.publicKey.slice(2) : profile.publicKey | ||
const verifier = new TokenVerifier('ES256K', publicKey) | ||
if (verifier.verify(jwt)) { | ||
@@ -27,0 +28,0 @@ if (payload.exp && payload.exp <= new Date().getTime()) { |
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
534906
13
15787
14
1