Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: auth0/node-jsonwebtoken
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: v2.0.0
Choose a base ref
...
head repository: auth0/node-jsonwebtoken
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: v3.0.0
Choose a head ref
  • 3 commits
  • 3 files changed
  • 1 contributor

Commits on Dec 29, 2014

  1. Copy the full SHA
    b648358 View commit details
  2. Copy the full SHA
    d958fca View commit details
  3. 3.0.0

    jfromaniello committed Dec 29, 2014
    Copy the full SHA
    1076414 View commit details
Showing with 23 additions and 4 deletions.
  1. +1 −0 .travis.yml
  2. +8 −4 package.json
  3. +14 −0 test/encoding.tests.js
1 change: 1 addition & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
language: node_js
before_install: npm i -g npm@1.4.28
node_js:
- 0.8
- 0.10
12 changes: 8 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "jsonwebtoken",
"version": "2.0.0",
"version": "3.0.0",
"description": "JSON Web Token implementation (symmetric and asymmetric)",
"main": "index.js",
"scripts": {
@@ -19,10 +19,14 @@
"url": "https://github.com/auth0/node-jsonwebtoken/issues"
},
"dependencies": {
"jws": "~0.2.6"
"jws": "~1.0.0"
},
"devDependencies": {
"chai": "*",
"mocha": "*"
"atob": "~1.1.2",
"chai": "~1.10.0",
"mocha": "~2.1.0"
},
"engines": {
"npm": "~1.4.28"
}
}
14 changes: 14 additions & 0 deletions test/encoding.tests.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
var jwt = require('../index');
var expect = require('chai').expect;
var atob = require('atob');

describe('encoding', function() {

it('should properly encode the token', function () {
var expected = 'José';
var token = jwt.sign({ name: expected }, 'shhhhh');
var decoded_name = JSON.parse(atob(token.split('.')[1])).name;
expect(decoded_name).to.equal(expected);
});

});