Skip to content

Commit

Permalink
Fixed bug when calling getCodeplex after a token timeout
Browse files Browse the repository at this point in the history
  • Loading branch information
abe545 committed Apr 15, 2014
1 parent 8187eab commit f879fbb
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions lib/codeplex.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,16 +38,16 @@ function getCodeplex(account, appConfig, resourcePath, callback) {
if (fin.Message) {
if (appConfig.clientId && appConfig.clientSecret && fin.Message === 'Authentication required.') {
var tokenProvider = new TokenProvider('https://www.codeplex.com/oauth/token', {
refresh_token: account.refreshToken,
client_id: appConfig.clientId,
client_secret: appConfig.clientSecret
refresh_token: account.refreshToken,
client_id: appConfig.clientId,
client_secret: appConfig.clientSecret
});

tokenProvider.getToken(function (err, token) {
if (err) { callback(err, null); }
else {
account.accessToken = token;
getCodeplex(account, resourcePath, callback);
getCodeplex(account, appConfig, resourcePath, callback);
}
});
}
Expand Down

0 comments on commit f879fbb

Please sign in to comment.