Skip to content
This repository has been archived by the owner on Sep 7, 2021. It is now read-only.

Commit

Permalink
Merge branch 'master' of github.com:btspoony/node-social
Browse files Browse the repository at this point in the history
  • Loading branch information
guileen committed Feb 20, 2012
2 parents 1ba146e + a9de8d9 commit c85a469
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions lib/renren.js
Expand Up @@ -69,23 +69,20 @@ Renren.prototype.getOAuthAccessToken = function (code, redirectURI, callback) {
// set expire date
if(result['expires_in']){
var expire_at = Date.now() + result['expires_in']*1000 ;
var r_expire_at = Date.now() + result['expires_in']*1000*2 ;
}

// store the access token in the data
data.token = access_token;
data.refresh = refresh_token;
data.expire = expire_at;
data.r_expire = r_expire_at;
data.authorized = true;

callback(null, data);
};

// if has refresh token
if(this.refresh && this.r_expire && Date.now() < this.r_expire){

this.oa2.refreshAccessToken(this.refresh, {
if( data.refresh ){
this.oa2.refreshAccessToken( data.refresh, {
grant_type: 'refresh_token'
}, access_cbfunc );

Expand Down

0 comments on commit c85a469

Please sign in to comment.