Skip to content

Commit

Permalink
Merge pull request #440 from auth0/feature-upgrade-idtoken-verifier
Browse files Browse the repository at this point in the history
Fix decoding base64 string with special characters
  • Loading branch information
hzalaz committed May 19, 2017
2 parents bdce0d5 + c9f69f4 commit 291f0d9
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 8 deletions.
1 change: 1 addition & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
/node_modules/*
**/node_modules/*
/build/*
/test/*
10 changes: 5 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,10 @@
"scripts": {
"start": "gulp dev",
"build": "gulp build",
"test": "mocha test/**/*.test.js",
"test": "mocha test/**/*.test.js test/setup.js",
"test:integration": "mocha-parallel-tests --max-parallel 2 integration/**/*.test.js",
"test:watch": "mocha --watch -R min test/**/*.test.js",
"ci:test": "istanbul cover _mocha --report lcovonly -R test/**/* -- -R mocha-multi --reporter-options spec=-,mocha-junit-reporter=-",
"test:watch": "mocha --watch -R min test/**/*.test.js test/setup.js",
"ci:test": "istanbul cover _mocha --report lcovonly -R test/**/* test/setup.js -- -R mocha-multi --reporter-options spec=-,mocha-junit-reporter=-",
"ci:coverage": "codecov",
"lint": "eslint ./src",
"lint:fix": "eslint --fix ./src",
Expand All @@ -37,7 +37,7 @@
"license": "MIT",
"dependencies": {
"base64-js": "^1.2.0",
"idtoken-verifier": "^1.0.1",
"idtoken-verifier": "^1.0.2",
"qs": "^6.4.0",
"superagent": "^3.3.1",
"url-join": "^1.1.0",
Expand Down Expand Up @@ -95,4 +95,4 @@
"git add"
]
}
}
}
11 changes: 11 additions & 0 deletions test/setup.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
before(function() {
function atob(str) {
return new Buffer(str, 'base64').toString('binary');
}
function btoa(str) {
return Buffer.from(str, 'binary').toString('base64');
}
var windowOrGlobal = typeof window !== 'undefined' ? window : global;
windowOrGlobal.atob = atob;
windowOrGlobal.btoa = btoa;
});
6 changes: 3 additions & 3 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -1942,9 +1942,9 @@ husky@^0.13.3:
is-ci "^1.0.9"
normalize-path "^1.0.0"

idtoken-verifier@^1.0.1:
version "1.0.1"
resolved "https://registry.yarnpkg.com/idtoken-verifier/-/idtoken-verifier-1.0.1.tgz#7563af238dfbc5aa2995744c37bf01dea3ad08ab"
idtoken-verifier@^1.0.2:
version "1.0.2"
resolved "https://registry.yarnpkg.com/idtoken-verifier/-/idtoken-verifier-1.0.2.tgz#7457d8b3d13e59ca3ab085ed43d2b43e48536f1d"
dependencies:
base64-js "^1.2.0"
crypto-js "^3.1.9-1"
Expand Down

0 comments on commit 291f0d9

Please sign in to comment.