nicholastay / passport-discord

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

Set Scopes #13

Closed owen-m1 closed 5 years ago

owen-m1 commented 6 years ago

Why is there no way to set scopes? Only bot permissions? This whole package is useless.

nicholastay commented 6 years ago

check the example server

neromaki commented 5 years ago

Would've been pretty easy to just paste the example code instead of "check the example server":

var scopes = ['identify', 'email', 'guilds', 'guilds.join'];

passport.use(new Strategy({
    clientID: '',
    clientSecret: '',
    callbackURL: 'http://localhost:5000/callback',
    scope: scopes
}, function(accessToken, refreshToken, profile, done) {
    process.nextTick(function() {
        return done(null, profile);
    });
}));

Is the relevant code @owen-mills, presumably you need to pass an array of 1 if using a single scope such as authorize or email