Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
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...
commit 2be70861ad6e5ffc9f566426e4ccb00119a27719 1 parent dc0b92c
@gidzone authored
Showing with 2 additions and 1 deletion.
  1. +2 −1  lib/oauth2.js
View
3  lib/oauth2.js
@@ -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);
Please sign in to comment.
Something went wrong with that request. Please try again.