passport-oauth2 icon indicating copy to clipboard operation
passport-oauth2 copied to clipboard

Next is not a function

Open davich opened this issue 5 years ago • 1 comments

Strategy calls error here (passport-oauth2/lib/strategy.js:175). Error function (passport/lib/middleware/authenticate.js:361) expects there to be a next variable in scope. There is no next variable in scope.

{ "errorType": "TypeError", "errorMessage": "next is not a function", "stack": [ "TypeError: next is not a function", " at OAuth2Strategy.strategy.error (/var/task/node_modules/passport/lib/middleware/authenticate.js:361:9)", " at /var/task/node_modules/passport-oauth2/lib/strategy.js:175:34", " at /var/task/node_modules/oauth/lib/oauth2.js:191:18", " at passBackControl (/var/task/node_modules/oauth/lib/oauth2.js:132:9)", " at IncomingMessage. (/var/task/node_modules/oauth/lib/oauth2.js:157:7)", " at IncomingMessage.emit (events.js:323:22)", " at IncomingMessage.EventEmitter.emit (domain.js:482:12)", " at IncomingMessage.wrapped (/var/task/node_modules/newrelic/lib/transaction/tracer/index.js:188:22)", " at IncomingMessage.wrappedResponseEmit (/var/task/node_modules/newrelic/lib/instrumentation/core/http-outbound.js:218:24)", " at endReadableNT (_stream_readable.js:1204:12)" ] }

davich avatar May 08 '20 04:05 davich

At the least could you have a default callback that throws the error, so the error message doesn't get lost?

davich avatar May 08 '20 05:05 davich