freeCodeCamp/api-server/server/passport-providers.js

43 lines
1.1 KiB
JavaScript
Raw Normal View History

import { auth0 } from '../../config/secrets';
import { homeLocation, apiLocation } from '../../config/env';
const { clientID, clientSecret, domain } = auth0;
const successRedirect = `${homeLocation}/learn`;
const failureRedirect = `${homeLocation}/signin`;
export default {
devlogin: {
authScheme: 'mock',
provider: 'dev',
module: 'passport-mock-strategy'
},
2015-06-04 17:52:12 +00:00
local: {
provider: 'local',
module: 'passport-local',
usernameField: 'email',
passwordField: 'password',
authPath: '/auth/local',
successRedirect: successRedirect,
failureRedirect: failureRedirect,
2015-06-10 00:22:14 +00:00
session: true,
2015-06-04 17:52:12 +00:00
failureFlash: true
},
'auth0-login': {
provider: 'auth0',
module: 'passport-auth0',
clientID,
clientSecret,
domain,
cookieDomain: process.env.COOKIE_DOMAIN || 'localhost',
callbackURL: `${apiLocation}/auth/auth0/callback`,
authPath: '/auth/auth0',
callbackPath: '/auth/auth0/callback',
2018-05-20 08:10:15 +00:00
useCustomCallback: true,
successRedirect: successRedirect,
failureRedirect: failureRedirect,
scope: ['openid profile email'],
failureFlash: true
2015-06-04 17:52:12 +00:00
}
};