Permalink
Browse files

Handle the 302 response like the 200.

Salesforce returns at 302 with its oath flow.  Handle the 302 status
code like the 200.
  • Loading branch information...
1 parent dc0b92c commit 2be70861ad6e5ffc9f566426e4ccb00119a27719 @gidzone committed Sep 1, 2011
Showing with 2 additions and 1 deletion.
  1. +2 −1 lib/oauth2.js
View
@@ -64,7 +64,8 @@ exports.OAuth2.prototype._request= function(method, url, headers, post_body, acc
function passBackControl( response, result ) {
if(!callbackCalled) {
callbackCalled=true;
- if( response.statusCode != 200 ) {
+ //handle 302 responses like 200
+ if( response.statusCode != 200 && response.statusCode != 302) {
callback({ statusCode: response.statusCode, data: result });
} else {
callback(null, result, response);

0 comments on commit 2be7086

Please sign in to comment.