const Auth0Strategy = require("passport-auth0") const passport = require("passport") const config = require("../config") //passport-auth0 const strategy = new Auth0Strategy({ domain: config.auth0.domain, clientID: config.auth0.clientId, clientSecret: config.auth0.secret, // Replace this with the client secret for your app callbackURL: config.root + "/auth/callback", state: true, }, (accessToken, refreshToken, extraParams, profile, done) => { // accessToken is the token to call Auth0 API (not needed in the most cases) // extraParams.id_token has the JSON Web Token // profile has all the information from the user return done(null, profile); } ) passport.use(strategy) passport.serializeUser(function(user, done) { done(null, user); }); passport.deserializeUser(function(user, done) { done(null, user); }); module.exports = passport