2018-10-23 23:24:48 +00:00
|
|
|
import { auth0 } from '../../config/secrets';
|
|
|
|
import { homeLocation } from '../../config/env.json';
|
|
|
|
|
|
|
|
const { clientID, clientSecret, domain } = auth0;
|
|
|
|
|
|
|
|
const successRedirect = `${homeLocation}/welcome`;
|
|
|
|
const failureRedirect = '/signin';
|
2016-06-24 03:05:30 +00:00
|
|
|
|
|
|
|
export default {
|
2015-06-04 17:52:12 +00:00
|
|
|
local: {
|
|
|
|
provider: 'local',
|
|
|
|
module: 'passport-local',
|
|
|
|
usernameField: 'email',
|
|
|
|
passwordField: 'password',
|
|
|
|
authPath: '/auth/local',
|
|
|
|
successRedirect: successRedirect,
|
2018-04-13 14:48:10 +00:00
|
|
|
failureRedirect: failureRedirect,
|
2015-06-10 00:22:14 +00:00
|
|
|
session: true,
|
2015-06-04 17:52:12 +00:00
|
|
|
failureFlash: true
|
|
|
|
},
|
2018-05-16 22:06:11 +00:00
|
|
|
'auth0-login': {
|
|
|
|
provider: 'auth0',
|
|
|
|
module: 'passport-auth0',
|
2018-10-23 23:24:48 +00:00
|
|
|
clientID,
|
|
|
|
clientSecret,
|
|
|
|
domain,
|
2018-05-19 08:39:27 +00:00
|
|
|
cookieDomain: 'freeCodeCamp.org',
|
2018-05-16 22:06:11 +00:00
|
|
|
callbackURL: '/auth/auth0/callback',
|
|
|
|
authPath: '/auth/auth0',
|
|
|
|
callbackPath: '/auth/auth0/callback',
|
2018-05-20 08:10:15 +00:00
|
|
|
useCustomCallback: true,
|
2018-05-16 22:06:11 +00:00
|
|
|
successRedirect: successRedirect,
|
|
|
|
failureRedirect: failureRedirect,
|
2018-06-28 14:57:15 +00:00
|
|
|
scope: ['openid profile email'],
|
2018-05-16 22:06:11 +00:00
|
|
|
failureFlash: true
|
2015-06-04 17:52:12 +00:00
|
|
|
}
|
|
|
|
};
|