Comparing version 2.0.0 to 2.0.1
@@ -76,3 +76,3 @@ var querystring = require('querystring'); | ||
token.access_token = result.access_token; | ||
token.refresh_token = result.refresh_token; | ||
token.refresh_token = result.refresh_token || token.refresh_token; | ||
client.emit('tokenRefresh'); | ||
@@ -79,0 +79,0 @@ client.getFeed(url, params, callback); |
{ | ||
"name": "gdata-js", | ||
"description": "Simple OAuth 2.0 GData API client", | ||
"version": "2.0.0", | ||
"version": "2.0.1", | ||
"author": "Simon Murtha-Smith <simon@murtha-smith.com>", | ||
@@ -6,0 +6,0 @@ "keywords": ["google", "gdata"], |
23
test.js
@@ -20,2 +20,4 @@ var request = require('request'); | ||
var token; | ||
app.get('/', function (req, res) { | ||
@@ -25,3 +27,3 @@ // see https://developers.google.com/accounts/docs/OAuth2WebServer for options | ||
access_type: 'offline', | ||
approval_prompt: 'force'}, req, res, function(err, token) { | ||
approval_prompt: 'force'}, req, res, function(err, _token) { | ||
if(err) { | ||
@@ -32,2 +34,4 @@ console.error('oh noes!', err); | ||
} else { | ||
token = _token; | ||
console.log('got token:', token); | ||
res.redirect('/getStuff'); | ||
@@ -49,6 +53,19 @@ } | ||
}); | ||
}) | ||
}); | ||
app.listen(8553); | ||
app.get('/refresh', function(req, res) { | ||
console.log('forcing refresh...'); | ||
gdataClient._refreshToken(function(err, result) { | ||
console.log('err,', err); | ||
console.log('result,', result); | ||
console.log('token,', token); | ||
}); | ||
}); | ||
gdataClient.on('tokenRefresh', function() { | ||
console.log('token refresh!', token); | ||
}); | ||
app.listen(process.argv[4] || 8553); | ||
console.log('open http://localhost:8553'); | ||
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
8399
189