2018-10-23 23:24:48 +00:00
|
|
|
import { auth0 } from '../../config/secrets';
|
2019-02-13 12:14:25 +00:00
|
|
|
import { homeLocation, apiLocation } from '../../config/env';
|
2018-10-23 23:24:48 +00:00
|
|
|
|
|
|
|
const { clientID, clientSecret, domain } = auth0;
|
|
|
|
|
|
|
|
const successRedirect = `${homeLocation}/welcome`;
|
2019-02-13 12:14:25 +00:00
|
|
|
const failureRedirect = `${homeLocation}/signin`;
|
2016-06-24 03:05:30 +00:00
|
|
|
|
|
|
|
export default {
|
2018-10-30 21:17:07 +00:00
|
|
|
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,
|
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,
|
2019-02-13 12:14:25 +00:00
|
|
|
cookieDomain: process.env.COOKIE_DOMAIN || 'localhost',
|
|
|
|
callbackURL: `${apiLocation}/auth/auth0/callback`,
|
2018-05-16 22:06:11 +00:00
|
|
|
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
|
|
|
}
|
|
|
|
};
|