nicholastay / passport-discord

Passport strategy for authentication with Discord (discordapp.com)
ISC License
172 stars 55 forks source link

Invalid URI #31

Closed Nuckerr closed 3 years ago

Nuckerr commented 3 years ago

My auth.js file: router.get('/discord/redirect', passpord.authenticate('discord'), (req, res) => { res.sendStatus(200); }); My discord.js file: passport.use(new DiscordStrategy({ clientID: config.bot.client_id, clientSecret: config.bot.client_secret, callbackURL: config.bot.callback_url, scope: ['identify', 'guilds'], prompt: 'consent' }, function(accessToken, refreshToken, profile, done) { }));

And I get an invalid uri error

(I would post this in a support discord server but I cant seem to find one)

officialpiyush commented 3 years ago

Can you check if the callback URL you passed as an option is one of the URL specified in the Redirects in the oauth2 section of your application page?

Image reference: image

Nuckerr commented 3 years ago

http://i.nucker.me/ZLjdD.png

officialpiyush commented 3 years ago

I see, what's the value of config.bot.callback_url?

nodgear commented 3 years ago

Remember to use / in the end of link on developer portal...

Nuckerr commented 3 years ago

ooh that might have been the problem, I will see when I come back to this project