Permalink
Browse files

Add support for refreshing an access token

  • Loading branch information...
lukebaker committed Mar 14, 2012
1 parent d300b4e commit e1a8422e7c8866fb416166992d37976babdaaeca
Showing with 2 additions and 1 deletion.
  1. +2 −1 lib/oauth2.js
View
@@ -109,7 +109,8 @@ exports.OAuth2.prototype.getOAuthAccessToken= function(code, params, callback) {
params['client_id'] = this._clientId;
params['client_secret'] = this._clientSecret;
params['type']= 'web_server';
- params['code']= code;
+ var codeParam = (params.grant_type === 'refresh_token') ? 'refresh_token' : 'code';
+ params[codeParam]= code;
var post_data= querystring.stringify( params );
var post_headers= {

0 comments on commit e1a8422

Please sign in to comment.