Comparing version
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
URL strings
Supply chain riskPackage contains fragments of external URLs or IP addresses, which the package may be accessing at runtime.
Found 1 instance in 1 package
URL strings
Supply chain riskPackage contains fragments of external URLs or IP addresses, which the package may be accessing at runtime.
Found 1 instance in 1 package
41897
0.62%776
1.04%23
-4.17%9
80%