Comparing version 0.1.0 to 0.2.0
19
lib.js
@@ -10,9 +10,8 @@ var request = require('request'); | ||
client.getAuthorizeURL = function(service, callbackURLOverride) { | ||
var cbURL = callbackURLOverride || redirectURI; | ||
return apiBaseUrl + '/oauth/authorize?' + querystring.stringify({ | ||
client_id: clientId, | ||
redirect_uri: cbURL, | ||
service: service | ||
}); | ||
client.getAuthorizeURL = function(service, options) { | ||
if (!options.client_id) options.client_id = clientId; | ||
if (!options.redirect_uri) options.redirect_uri = redirectURI; | ||
options.service = service; | ||
var cbURL = options.callbackURL || redirectURI; | ||
return apiBaseUrl + '/oauth/authorize?' + querystring.stringify(options); | ||
} | ||
@@ -34,8 +33,8 @@ | ||
}, function (err, resp, body) { | ||
if(err) return callback(err, body); | ||
if(err) return callback(err, resp, body); | ||
try { | ||
body = JSON.parse(body); | ||
callback(undefined, body); | ||
callback(undefined, resp, body); | ||
} catch(parseErr) { | ||
callback(err, body); | ||
callback(err, resp, body); | ||
} | ||
@@ -42,0 +41,0 @@ }); |
@@ -5,3 +5,3 @@ { | ||
"description": "Client library for the Singly API", | ||
"version": "0.1.0", | ||
"version": "0.2.0", | ||
"homepage": "https://singly.com", | ||
@@ -8,0 +8,0 @@ "main" : "lib.js", |
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
4432
111