bnoguchi / everyauth

node.js auth package (password, facebook, & more) for Connect and Express apps
http://everyauth.com/
3.49k stars 447 forks source link

To handle error when the facebook app is in sandbox mode #457

Closed manu closed 10 years ago

manu commented 10 years ago

To fix the following

GET /auth/facebook/callback?error_code=901&error_message=This+app+is+in+sandbox+mode.++Edit+the+app+configuration+at+http%3A%2F%2Fdevelopers.facebook.com%2Fapps+to+make+the+app+publicly+visible. 500 28ms - 21b

        ^
Error: Can't render headers after they are sent to the client.
at ServerResponse.res._renderHeaders (/app/node_modules/express/node_modules/connect/lib/patch.js:69:27)
     at ServerResponse.writeHead (http.js:1065:20)
 http.js:721
     throw new Error('Can\'t render headers after they are sent to the client.'
     at ServerResponse.OutgoingMessage._renderHeaders (http.js:721:11)
     at ServerResponse.res.writeHead (/app/node_modules/express/node_modules/connect/lib/patch.js:75:22)
     at EveryModule._moduleErrback (/app/node_modules/everyauth/lib/modules/facebook.js:60:22)
     at errorCallback (/app/node_modules/everyauth/lib/step.js:29:15)
     at Promise.fail (/app/node_modules/everyauth/lib/promise.js:56:20)
     at Request.init.self.callback (/app/node_modules/everyauth/node_modules/request/main.js:120:22)
     at Request.module.exports.everyModule.submodule.definit.configurable.get.step.accepts.promises.step.accepts.promises.get.step.description.accepts.promises.canBreakTo.step.accepts.promises.step.accepts.promises.step.accepts.promises.step.accepts.promises.step.accepts.promises.step.accepts.promises.step.accepts.promises.stepseq.step.accepts.promises.getAuthUri.requestAuthUri.getCode.getAccessToken.compile.compiled.accessToken [as _callback] (/app/node_modules/everyauth/lib/modules/oauth2.js:189:57)
remoe commented 10 years ago

+1

I've got the same issue:

Missing code in querystring. The url looks like /auth/facebook/callback?error_code=901&error_message=This+app+is+in+sandbox+mode.++Edit+the+appnfiguration+at+http%3A%2F%2Fdevelopers.facebook.com%2Fapps+to+make+the+app+publicly+visible.
Error: Step getCode of `facebook` is promising: code ; however, the step returns nothing. Fix the step by returning the expected values OR by rrning a Promise that promises said values.
    at Step.exec (/app/node_modules/everyauth/lib/step.js:79:7)
    at RouteTriggeredSequence.StepSequence.start (/app/node_modules/everyauth/lib/stepSequence.js:46:35)
    at RouteTriggeredSequence.routeHandler (/app/node_modules/everyauth/lib/routeTriggeredSequence.js:17:7)
    at callbacks (/app/node_modules/everyauth/node_modules/express/lib/router/index.js:164:37)
    at param (/app/node_modules/everyauth/node_modules/express/lib/router/index.js:138:11)
    at pass (/app/node_modules/everyauth/node_modules/express/lib/router/index.js:145:5)
    at Router._dispatch (/app/node_modules/everyauth/node_modules/express/lib/router/index.js:173:5)
    at /app/node_modules/everyauth/index.js:47:16
    at fetchUserFromSession (/app/node_modules/everyauth/index.js:91:37)
    at Object.handle (/app/node_modules/everyauth/index.js:43:5)
SANJAYGMNIT commented 10 years ago

Hi, I am facing same issue and using latest stable version of EveryAuth (0.4.5), So wanted to know when we can have this fix merged to Master branch