nicholastay / passport-discord

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

User not defined #14

Closed carloverhamme closed 5 years ago

carloverhamme commented 5 years ago

var DiscordStrategy = require('passport-discord').Strategy;

passport.use(new DiscordStrategy({ clientID: 'id', clientSecret: 'secret', callbackURL: 'callbackURL' }, function(accessToken, refreshToken, profile, cb) { if (err) return done(err);

User.findOrCreate({ discordId: profile.id }, function(err, user) {
    return cb(err, user);
});

}));


"User" is undefined. Is there a way to define it?

nicholastay commented 5 years ago

This User... code is only an example. You must replace this part with your own desired callback. Check the example server for further guidance, as well as passport's own documentation.