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

38 lines
969 B
JavaScript
Raw Normal View History

import { auth0 } from '../../config/secrets';
import { homeLocation } from '../../config/env.json';
const { clientID, clientSecret, domain } = auth0;
const successRedirect = `${homeLocation}/welcome`;
const failureRedirect = '/signin';
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,
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,
2018-05-19 08:39:27 +00:00
cookieDomain: 'freeCodeCamp.org',
callbackURL: '/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
}
};