diff --git a/api-server/server/passport-providers.js b/api-server/server/passport-providers.js index f157ed193f..1298a3d25e 100644 --- a/api-server/server/passport-providers.js +++ b/api-server/server/passport-providers.js @@ -1,10 +1,10 @@ import { auth0 } from '../../config/secrets'; -import { homeLocation } from '../../config/env'; +import { homeLocation, apiLocation } from '../../config/env'; const { clientID, clientSecret, domain } = auth0; const successRedirect = `${homeLocation}/welcome`; -const failureRedirect = '/signin'; +const failureRedirect = `${homeLocation}/signin`; export default { devlogin: { @@ -29,8 +29,8 @@ export default { clientID, clientSecret, domain, - cookieDomain: 'freeCodeCamp.org', - callbackURL: '/auth/auth0/callback', + cookieDomain: process.env.COOKIE_DOMAIN || 'localhost', + callbackURL: `${apiLocation}/auth/auth0/callback`, authPath: '/auth/auth0', callbackPath: '/auth/auth0/callback', useCustomCallback: true,