passport-facebook
passport-facebook copied to clipboard
parseErrorResponse with undefined clientSecret
Got a not really helpful 500 error message
server_1 | Error
server_1 | at Strategy.parseErrorResponse (/usr/src/app/node_modules/passport-facebook/lib/strategy.js:196:12)
server_1 | at Strategy.OAuth2Strategy._createOAuthError (/usr/src/app/node_modules/passport-oauth2/lib/strategy.js:376:16)
server_1 | at /usr/src/app/node_modules/passport-oauth2/lib/strategy.js:166:45
server_1 | at /usr/src/app/node_modules/oauth/lib/oauth2.js:191:18
server_1 | at passBackControl (/usr/src/app/node_modules/oauth/lib/oauth2.js:132:9)
server_1 | at IncomingMessage.<anonymous> (/usr/src/app/node_modules/oauth/lib/oauth2.js:157:7)
server_1 | at emitNone (events.js:110:20)
server_1 | at IncomingMessage.emit (events.js:207:7)
server_1 | at endReadableNT (_stream_readable.js:1047:12)
server_1 | at _combinedTickCallback (internal/process/next_tick.js:102:11)
server_1 | at process._tickDomainCallback (internal/process/next_tick.js:198:9)
Occured due to an undefined clientSecret value.
Found it after spending way too much time debugging. Error
as a message was not very helpful in this case.
You could say that the configuration is wrong and print out the given object. Maybe pointing out which parameter is wrong.
Seems to be answered in #100
router.get('/login/facebook/return',
(req, res, next) => {
return passport.authenticate('facebook', {
failureRedirect: '/login',
session: false
},
(err, user, info) => {
if(err) {
logger.error(err);
res.redirect('/login');
}
else
{
next();
}
})(req, res, next);
})
Same here with heroku