@@ -17,13 +17,7 @@ import NewPasswordView from './modules/User/pages/NewPasswordView';
17
17
import AccountView from './modules/User/pages/AccountView' ;
18
18
import CollectionView from './modules/User/pages/CollectionView' ;
19
19
import DashboardView from './modules/User/pages/DashboardView' ;
20
- import RedirectToUser from './components/createRedirectWithUsername' ;
21
20
import { getUser } from './modules/User/actions' ;
22
- import {
23
- userIsAuthenticated ,
24
- userIsNotAuthenticated ,
25
- userIsAuthorized
26
- } from './utils/auth' ;
27
21
28
22
/**
29
23
* `params` is no longer a top-level route component prop in v4.
@@ -51,25 +45,19 @@ Route.propTypes = {
51
45
const routes = (
52
46
< Switch >
53
47
< 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 } />
56
50
< Route
57
51
path = "/reset-password/:reset_password_token"
58
52
component = { NewPasswordView }
59
53
/>
60
- < Route
61
- path = "/reset-password"
62
- component = { userIsNotAuthenticated ( ResetPasswordView ) }
63
- />
54
+ < Route path = "/reset-password" component = { ResetPasswordView } />
64
55
< Route path = "/verify" component = { EmailVerificationView } />
65
56
< Route path = "/projects/:project_id" component = { IDEView } />
66
57
< Route path = "/:username/full/:project_id" component = { FullView } />
67
58
< Route path = "/full/:project_id" component = { FullView } />
68
59
69
- < Route
70
- path = "/:username/assets"
71
- component = { userIsAuthenticated ( userIsAuthorized ( DashboardView ) ) }
72
- />
60
+ < Route path = "/:username/assets" component = { DashboardView } />
73
61
< Route
74
62
path = "/:username/sketches/:project_id/add-to-collection"
75
63
component = { IDEView }
@@ -81,18 +69,10 @@ const routes = (
81
69
component = { CollectionView }
82
70
/>
83
71
< 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 } />
94
75
< Route path = "/about" component = { IDEView } />
95
-
96
76
< Route path = "/privacy-policy" component = { PrivacyPolicy } />
97
77
< Route path = "/terms-of-use" component = { TermsOfUse } />
98
78
< Route path = "/code-of-conduct" component = { CodeOfConduct } />
0 commit comments