@@ -17,13 +17,7 @@ import NewPasswordView from './modules/User/pages/NewPasswordView';
1717import AccountView from './modules/User/pages/AccountView' ;
1818import CollectionView from './modules/User/pages/CollectionView' ;
1919import DashboardView from './modules/User/pages/DashboardView' ;
20- import RedirectToUser from './components/createRedirectWithUsername' ;
2120import { getUser } from './modules/User/actions' ;
22- import {
23- userIsAuthenticated ,
24- userIsNotAuthenticated ,
25- userIsAuthorized
26- } from './utils/auth' ;
2721
2822/**
2923 * `params` is no longer a top-level route component prop in v4.
@@ -51,25 +45,19 @@ Route.propTypes = {
5145const routes = (
5246 < Switch >
5347 < Route exact path = "/" component = { IDEView } />
54- < Route path = "/login" component = { userIsNotAuthenticated ( LoginView ) } />
55- < Route path = "/signup" component = { userIsNotAuthenticated ( SignupView ) } />
48+ < Route path = "/login" component = { LoginView } />
49+ < Route path = "/signup" component = { SignupView } />
5650 < Route
5751 path = "/reset-password/:reset_password_token"
5852 component = { NewPasswordView }
5953 />
60- < Route
61- path = "/reset-password"
62- component = { userIsNotAuthenticated ( ResetPasswordView ) }
63- />
54+ < Route path = "/reset-password" component = { ResetPasswordView } />
6455 < Route path = "/verify" component = { EmailVerificationView } />
6556 < Route path = "/projects/:project_id" component = { IDEView } />
6657 < Route path = "/:username/full/:project_id" component = { FullView } />
6758 < Route path = "/full/:project_id" component = { FullView } />
6859
69- < Route
70- path = "/:username/assets"
71- component = { userIsAuthenticated ( userIsAuthorized ( DashboardView ) ) }
72- />
60+ < Route path = "/:username/assets" component = { DashboardView } />
7361 < Route
7462 path = "/:username/sketches/:project_id/add-to-collection"
7563 component = { IDEView }
@@ -81,18 +69,10 @@ const routes = (
8169 component = { CollectionView }
8270 />
8371 < Route path = "/:username/collections" component = { DashboardView } />
84-
85- < Route
86- path = "/sketches"
87- component = { ( ) => < RedirectToUser url = "/:username/sketches" /> }
88- />
89- < Route
90- path = "/assets"
91- component = { ( ) => < RedirectToUser url = "/:username/assets" /> }
92- />
93- < Route path = "/account" component = { userIsAuthenticated ( AccountView ) } />
72+ < Route path = "/sketches" />
73+ < Route path = "/assets" />
74+ < Route path = "/account" component = { AccountView } />
9475 < Route path = "/about" component = { IDEView } />
95-
9676 < Route path = "/privacy-policy" component = { PrivacyPolicy } />
9777 < Route path = "/terms-of-use" component = { TermsOfUse } />
9878 < Route path = "/code-of-conduct" component = { CodeOfConduct } />
0 commit comments