Skip to content
Browse files

Iterator for recoverKeys. Fixes #2

  • Loading branch information...
1 parent bd59731 commit b30c81a4286f13fe54346d368b92fc836f8bcccb Dean Sofer committed Apr 5, 2012
Showing with 3 additions and 6 deletions.
  1. +2 −5 lib/resteasy.js
  2. +1 −1 test/linkedin.test.js
View
7 lib/resteasy.js
@@ -93,11 +93,8 @@ function escape(params) {
}
function recoverKeys(request) {
prepSession(request);
- // TODO: use iterator instead
- if (request.session.resteasy[targetApi].oauth_token) {
- keys.oauth_token = request.session.resteasy[targetApi].oauth_token;
- keys.oauth_token_secret = request.session.resteasy[targetApi].oauth_token_secret;
- keys.oauth_authorize_url = request.session.resteasy[targetApi].oauth_authorize_url;
+ for (var token in request.session.resteasy[targetApi]) {
+ keys[token] = request.session.resteasy[targetApi][token];
}
};
View
2 test/linkedin.test.js
@@ -33,7 +33,7 @@ app.get('/auth/resteasy/callback', function(request, response) {
});
app.get('/resteasy/me', function(request, response) {
- resteasy.read(request, 'people', { id: '12345'}, function(error, data, _response) {
+ resteasy.read(request, 'people', { url: 'http://www.linkedin.com/in/deansofer'}, function(error, data, _response) {
if (error) {
response.send(error);
} else {

0 comments on commit b30c81a

Please sign in to comment.
Something went wrong with that request. Please try again.