discord-oauth2-client
v1.0.3
Published
Passport strategy for authentication with Discord
Downloads
16
Maintainers
Readme
Example Usage
const Strategy = require("discord-oauth2-client").Strategy;
const passport = require("passport");
passport.use(new Strategy({
clientID: '', // https://discord.com/developers/applications
clientSecret: '', // https://discord.com/developers/applications
callbackURL: '/callback',
scope: ['identify', 'guilds'],
prompt: 'none'
}, function(accessToken, refreshToken, profile, done) {
process.nextTick(function() {
return done(null, profile);
});
}));
passport.serializeUser(function(user, done) {
done(null, user);
});
passport.deserializeUser(function(obj, done) {
done(null, obj);
});