Advanced Node and Express - Set up environment

Hi,

I’m getting the following error when trying to login via github

TypeError: Cannot read property '0' of undefined at Strategy._verify (/app/app/auth.js:37:40) at /rbd/pnpm-volume/73d30a17-96d2-42b7-a8b6-3ad6f0c2881c/node_modules/.registry.npmjs.org/passport-oauth2/1.5.0/node_modules/passport-oauth2/lib/strategy.js:202:24 at /rbd/pnpm-volume/73d30a17-96d2-42b7-a8b6-3ad6f0c2881c/node_modules/.registry.npmjs.org/passport-github/1.1.0/node_modules/passport-github/lib/strategy.js:174:7 at passBackControl (/rbd/pnpm-volume/73d30a17-96d2-42b7-a8b6-3ad6f0c2881c/node_modules/.registry.npmjs.org/oauth/0.9.15/node_modules/oauth/lib/oauth2.js:134:9) at IncomingMessage.<anonymous> (/rbd/pnpm-volume/73d30a17-96d2-42b7-a8b6-3ad6f0c2881c/node_modules/.registry.npmjs.org/oauth/0.9.15/node_modules/oauth/lib/oauth2.js:157:7) at IncomingMessage.emit (events.js:194:15) at endReadableNT (_stream_readable.js:1125:12) at process._tickCallback (internal/process/next_tick.js:63:19)

I checked that I’d set up my .env file properly and the logs weren’t showing any error… what might I be missing here? Here’s my glitch https://glitch.com/edit/#!/honored-curtain

Did you figure this out? I can’t visit your link I’m getting it doesn’t exist. I’m thinking that you might have to change this line though, as I just came across this recently:
email: profile.emails[0].value || 'No public email,'
to:
email: profile.email || 'No public email',

Thanks for the response, I did figure it out :smile:

1 Like