Comparing version 3.0.0-edge to 3.1.0-edge
@@ -69,2 +69,3 @@ var _ = require('underscore'); | ||
* @param {string} [opts.identity] - The identity of the first person | ||
* @param {number} [opts.nbf] - Time from epoch in seconds for not before value | ||
*/ | ||
@@ -82,2 +83,3 @@ function AccessToken(accountSid, keySid, secret, opts) { | ||
this.identity = opts.identity; | ||
this.nbf = opts.nbf; | ||
this.grants = []; | ||
@@ -109,3 +111,3 @@ } | ||
var grants = {}; | ||
if (this.identity) { grants.identity = this.identity; } | ||
if (_.isString(this.identity)) { grants.identity = this.identity; } | ||
@@ -119,5 +121,5 @@ _.each(this.grants, function(grant) { | ||
jti: this.keySid + '-' + now, | ||
nbf: now, | ||
grants: grants | ||
}; | ||
if (_.isNumber(this.nbf)) { payload.nbf = this.nbf; } | ||
@@ -124,0 +126,0 @@ return jwt.sign(payload, this.secret, { |
{ | ||
"name": "twilio", | ||
"description": "A Twilio helper library", | ||
"version": "3.0.0-edge", | ||
"version": "3.1.0-edge", | ||
"author": "Kevin Whinnery <kevin.whinnery@gmail.com>", | ||
@@ -6,0 +6,0 @@ "contributors": [ |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
106673
58
2273