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

Error: Unknown authentication strategy "discord"

Open Mercy1127 opened this issue 4 years ago • 7 comments

Error: Unknown authentication strategy "discord" at attempt (C:\Users\#####\djs-bot\backend\node_modules\passport\lib\middleware\authenticate.js:190:39) at authenticate (C:\Users#####\djs-bot\backend\node_modules\passport\lib\middleware\authenticate.js:367:7) at Layer.handle [as handle_request] (C:\Users#####\djs-bot\backend\node_modules\express\lib\router\layer.js:95:5) at next (C:\Users#####\djs-bot\backend\node_modules\express\lib\router\route.js:137:13) at Route.dispatch (C:\Users#####\djs-bot\backend\node_modules\express\lib\router\route.js:112:3) at Layer.handle [as handle_request] (C:\Users#####\djs-bot\backend\node_modules\express\lib\router\layer.js:95:5) at C:\Users#####\djs-bot\backend\node_modules\express\lib\router\index.js:281:22 at Function.process_params (C:\Users#####\djs-bot\backend\node_modules\express\lib\router\index.js:335:12) at next (C:\Users#####\djs-bot\backend\node_modules\express\lib\router\index.js:275:10) at Function.handle (C:\Users#####\djs-bot\backend\node_modules\express\lib\router\index.js:174:3)

Mercy1127 avatar Feb 05 '21 20:02 Mercy1127

Can you provide your implementation code?

tonestrike avatar Feb 27 '21 08:02 tonestrike

We cannot help you unless you provide your code.

KingCh1ll avatar Jun 03 '21 21:06 KingCh1ll

hey i have the same problem.

i am following this guys tutorial: https://www.youtube.com/watch?v=DomtnrQ4f3Q (this is get a understanding of what the layout is)

here is the code for my auth.js file

const router = require('express').Router();
const passport = require('passport')



router.get('/discord', passport.authenticate('discord'));

router.get('/discord/callback', passport.authenticate('discord', {
    failureRedirect: '/'
}), function(req, res) {
    res.redirect('/secretstuff') // Successful auth
});

module.exports = router; 

CringeKidy avatar Jul 24 '21 09:07 CringeKidy

Nvm i figure out that i didn't have the passport strat

CringeKidy avatar Jul 24 '21 09:07 CringeKidy

I have the same issue..

Here is the strategy: https://pastebin.com/MwtYCc3A

MaikyDev1 avatar Jul 28 '21 08:07 MaikyDev1

hey @M4iky1 do you have your strat in the route for my problem i didnt have the start getting called anywhere

https://codepen.io/cringekidy/project/editor/AwpbjL have a look here to see what i am talking about

CringeKidy avatar Jul 28 '21 20:07 CringeKidy

thanks!

MaikyDev1 avatar Jul 29 '21 07:07 MaikyDev1