Comparing version 1.1.0 to 1.1.1
var jwt = require('jwt-simple'), | ||
qs = require('querystring'); | ||
function Capability(accountSid, authToken) { | ||
this.accountSid = accountSid; | ||
this.authToken = authToken; | ||
function Capability(sid, tkn) { | ||
// Initialize from environment variables, if present | ||
if (!sid || !tkn) { | ||
if (process.env.TWILIO_ACCOUNT_SID && process.env.TWILIO_AUTH_TOKEN) { | ||
this.accountSid = process.env.TWILIO_ACCOUNT_SID; | ||
this.authToken = process.env.TWILIO_AUTH_TOKEN; | ||
} | ||
else { | ||
throw 'Capability requires an Account SID and Auth Token set explicitly ' + | ||
'or via the TWILIO_ACCOUNT_SID and TWILIO_AUTH_TOKEN environment variables'; | ||
} | ||
} | ||
else { | ||
//if auth token/SID passed in manually, trim spaces | ||
this.accountSid = sid.replace(/ /g,''); | ||
this.authToken = tkn.replace(/ /g,''); | ||
} | ||
this.capabilities = []; | ||
@@ -8,0 +22,0 @@ } |
{ | ||
"name":"twilio", | ||
"description":"A Twilio helper library", | ||
"version":"1.1.0", | ||
"version":"1.1.1", | ||
"author":"Kevin Whinnery <kevin.whinnery@gmail.com>", | ||
@@ -6,0 +6,0 @@ "contributors":[ |
Sorry, the diff of this file is not supported yet
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
41897
776
23
8