kyle wip: this will break things

This commit is contained in:
Kyle McCormick
2020-02-13 12:48:06 -05:00
parent d4ce099596
commit 147f305cd2
3 changed files with 11 additions and 4 deletions

1
.env
View File

@@ -15,3 +15,4 @@ SEGMENT_KEY=null
SITE_NAME=null
SUPPORT_URL=null
USER_INFO_COOKIE_NAME=null
ENABLE_LOGIN_AND_REGISTRATION=null

View File

@@ -16,3 +16,4 @@ SEGMENT_KEY=null
SITE_NAME='edX'
SUPPORT_URL='http://localhost:18000/support'
USER_INFO_COOKIE_NAME='edx-user-info'
ENABLE_LOGIN_AND_REGISTRATION=true

View File

@@ -1,6 +1,6 @@
import 'babel-polyfill';
import 'formdata-polyfill';
import { AppProvider, ErrorPage } from '@edx/frontend-platform/react';
import { AppProvider, ErrorPage, AuthenticatedPageRoute } from '@edx/frontend-platform/react';
import { subscribe, initialize, APP_INIT_ERROR, APP_READY, mergeConfig } from '@edx/frontend-platform';
import React from 'react';
import ReactDOM from 'react-dom';
@@ -24,10 +24,14 @@ subscribe(APP_READY, () => {
<Header />
<main>
<Switch>
<Route exact path="/" component={AccountSettingsPage} />
<Route path="/login" component={LoginPage} />
<AuthenticatedPageRoute exact path="/" component={AccountSettingsPage} />
<Route path="/notfound" component={NotFoundPage} />
<Route path="/registration" component={RegistrationPage} />
{
getConfig().ENABLE_LOGIN_AND_REGISTRATION && <>
<Route path="/login" component={LoginPage} />
<Route path="/registration" component={RegistrationPage} />
</>
}
<Route path="*" component={NotFoundPage} />
</Switch>
</main>
@@ -53,6 +57,7 @@ initialize({
config: () => {
mergeConfig({
SUPPORT_URL: process.env.SUPPORT_URL,
ENABLE_LOGIN_AND_REGISTRATION: process.env.ENABLE_LOGIN_AND_REGISTRATION,
}, 'App loadConfig override handler');
},
},