Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Add support for refreshing an access token

  • Loading branch information...
commit e1a8422e7c8866fb416166992d37976babdaaeca 1 parent d300b4e
@lukebaker lukebaker authored
Showing with 2 additions and 1 deletion.
  1. +2 −1  lib/oauth2.js
View
3  lib/oauth2.js
@@ -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= {
Please sign in to comment.
Something went wrong with that request. Please try again.