Skip to content

Commit

Permalink
Removes jwt-simple from v2.x module
Browse files Browse the repository at this point in the history
  • Loading branch information
philnash committed Nov 7, 2016
1 parent 0d75878 commit db7f69a
Show file tree
Hide file tree
Showing 8 changed files with 14 additions and 15 deletions.
4 changes: 2 additions & 2 deletions lib/Capability.js
@@ -1,4 +1,4 @@
var jwt = require('jwt-simple'),
var jwt = require('jsonwebtoken'),
qs = require('querystring'),
utils = require('./utils');

Expand Down Expand Up @@ -71,7 +71,7 @@ Capability.prototype.generate = function(timeout) {
exp: Math.floor(new Date() / 1000) + expires
};

return jwt.encode(payload, this.authToken);
return jwt.sign(payload, this.authToken);
};

module.exports = Capability;
6 changes: 3 additions & 3 deletions lib/TaskRouterCapability.js
@@ -1,4 +1,4 @@
var jwt = require('jwt-simple');
var jwt = require('jsonwebtoken');
var deprecate = require('deprecate');
var _ = require('underscore')
require('string.prototype.startswith');
Expand Down Expand Up @@ -176,8 +176,8 @@ TaskRouterCapability.prototype._generate = function(ttl, extraAttributes) {
friendly_name: this.channelId,
policies: this.policies,
};
_.extend(payload, extraAttributes)
return jwt.encode(payload, this.authToken);
_.extend(payload, extraAttributes);
return jwt.sign(payload, this.authToken);
}

module.exports = TaskRouterCapability;
9 changes: 4 additions & 5 deletions package.json
Expand Up @@ -14,14 +14,13 @@
"url": "https://github.com/twilio/twilio-node.git"
},
"dependencies": {
"request": "2.74.x",
"underscore": "1.x",
"deprecate": "^0.1.0",
"jsonwebtoken": "5.4.x",
"jwt-simple": "0.1.x",
"q": "0.9.7",
"request": "2.74.x",
"scmp": "0.0.3",
"deprecate": "^0.1.0",
"string.prototype.startswith": "^0.2.0"
"string.prototype.startswith": "^0.2.0",
"underscore": "1.x"
},
"devDependencies": {
"express": "3.x",
Expand Down
2 changes: 1 addition & 1 deletion spec/task_router_capability.spec.js
@@ -1,5 +1,5 @@
var twilio = require('../index'),
jwt = require('jwt-simple');
jwt = require('jsonwebtoken');

describe('The TaskRouter Capability Token Object', function() {

Expand Down
2 changes: 1 addition & 1 deletion spec/task_router_capability_deprecated.spec.js
@@ -1,5 +1,5 @@
var twilio = require('../index'),
jwt = require('jwt-simple');
jwt = require('jsonwebtoken');

describe('The TaskRouter Capability Deprecated Token Object', function() {

Expand Down
2 changes: 1 addition & 1 deletion spec/task_router_capability_taskqueue.spec.js
@@ -1,5 +1,5 @@
var twilio = require('../index'),
jwt = require('jwt-simple');
jwt = require('jsonwebtoken');

describe('The TaskRouter TaskQueue Capability Token Object', function() {

Expand Down
2 changes: 1 addition & 1 deletion spec/task_router_capability_worker.spec.js
@@ -1,5 +1,5 @@
var twilio = require('../index'),
jwt = require('jwt-simple');
jwt = require('jsonwebtoken');

describe('The TaskRouter Worker Capability Token Object', function() {

Expand Down
2 changes: 1 addition & 1 deletion spec/task_router_capability_workspace.spec.js
@@ -1,5 +1,5 @@
var twilio = require('../index'),
jwt = require('jwt-simple');
jwt = require('jsonwebtoken');

describe('The TaskRouter Workspace Capability Token Object', function() {

Expand Down

0 comments on commit db7f69a

Please sign in to comment.