Tell us what’s happening:
My replit passes the test, but it says that I should be able to login by now, but when I try to login, it gives me the error below.
My code here: https://replit.com/@dletulle/boilerplate-advancednode Your project link(s)
Error: Unknown authentication strategy "github"
at attempt (/home/runner/boilerplate-advancednode/node_modules/passport/lib/middleware/authenticate.js:173:37)
at authenticate (/home/runner/boilerplate-advancednode/node_modules/passport/lib/middleware/authenticate.js:349:7)
at Layer.handle [as handle_request] (/home/runner/boilerplate-advancednode/node_modules/express/lib/router/layer.js:95:5)
at next (/home/runner/boilerplate-advancednode/node_modules/express/lib/router/route.js:137:13)
at Route.dispatch (/home/runner/boilerplate-advancednode/node_modules/express/lib/router/route.js:112:3)
at Layer.handle [as handle_request] (/home/runner/boilerplate-advancednode/node_modules/express/lib/router/layer.js:95:5)
at /home/runner/boilerplate-advancednode/node_modules/express/lib/router/index.js:281:22
at Function.process_params (/home/runner/boilerplate-advancednode/node_modules/express/lib/router/index.js:335:12)
at next (/home/runner/boilerplate-advancednode/node_modules/express/lib/router/index.js:275:10)
at SessionStrategy.strategy.pass (/home/runner/boilerplate-advancednode/node_modules/passport/lib/middleware/authenticate.js:325:9)
Your browser information:
User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/89.0.4389.90 Safari/537.36.
Challenge: Implementation of Social Authentication III
I’d really appreciate it if someone would give this a quick look over…
Even though the test pass, I don’t know if I should continue the course if my code is not working as intended.
I just tried github2, still didn’t work.
Probably worth mentioning, I just tried my “passport-local” login, and it gives the same message. I’m guessing it’s got something do to with passport that I’ve messed up. But it’s confusing because all the test have passed, so I don’t know what it could be.
I mean… I pass the test, but the instructions say I should be able to login by now and to try it. But neither my local or github work. I’ll check out that video you shared, but I may just complete it with it broken since I don’t know what’s wrong…
There are modifications required in two areas to pass the tests for this challenge. First, the changes to routes.js which seemed straightforward.
Second, you have to add the Github auth strategy appropriately in auth.js which was for me a bit trickier. At any rate, I found Shaun Hamilton’s solution quite helpful.