This is my app:
https://flower-question.glitch.me/
So the problem is my app is passing the FCC tests, but when I click on Login with Github then I get the following error:
TypeError: Cannot read property '0' of undefined
at Strategy._verify (/app/app/auth.js:37:40)
at /rbd/pnpm-volume/95184f4b-893d-4eca-a1e1-eba4175d32a6/node_modules/.registry.npmjs.org/passport-oauth2/1.4.0/node_modules/passport-oauth2/lib/strategy.js:193:24
at /rbd/pnpm-volume/95184f4b-893d-4eca-a1e1-eba4175d32a6/node_modules/.registry.npmjs.org/passport-github/1.1.0/node_modules/passport-github/lib/strategy.js:174:7
at passBackControl (/rbd/pnpm-volume/95184f4b-893d-4eca-a1e1-eba4175d32a6/node_modules/.registry.npmjs.org/oauth/0.9.15/node_modules/oauth/lib/oauth2.js:134:9)
at IncomingMessage.<anonymous> (/rbd/pnpm-volume/95184f4b-893d-4eca-a1e1-eba4175d32a6/node_modules/.registry.npmjs.org/oauth/0.9.15/node_modules/oauth/lib/oauth2.js:157:7)
at IncomingMessage.emit (events.js:187:15)
at endReadableNT (_stream_readable.js:1094:12)
at process._tickCallback (internal/process/next_tick.js:63:19)
I donât fully understand the error. Is it not connecting to my database?
There were some extra steps that werenât included in the lessons that I did to get it this far:
-Create a new OAuth App on Github. (Right now thereâs 1 user logged in.)
-Create a new database called âchatusersâ on mLab, and given it the user.
-Updated the .env to include the new DATABASE, GITHUBT_CLIENT_ID, and GITHUB-CLIENT-SECRET.
-Include this snippet that allows the tests to pass:
const cors = require('cors');
app.use(cors());
Iâve gotten this far in the lessons. As I say, the tests pass but the app itself isnât authorizing:
https://learn.freecodecamp.org/information-security-and-quality-assurance/advanced-node-and-express/set-up-the-environment/