Skip to content
Snippets Groups Projects

Feature/authorization/curry

Merged Defendi Alberto requested to merge feature/authorization/curry into dev
1 file
+ 7
14
Compare changes
  • Side-by-side
  • Inline
+ 7
14
@@ -15,7 +15,12 @@ import { NotFound } from 'components/NotFound/NotFound';
import { Unauthorized } from 'components/Unauthorized/Unauthorized';
import { LandingPage } from 'components/LandingPage/LandingPage';
const Personal = withAuthorization(Dashboard);
const All = withAuthorization([
Roles.admin,
Roles.operator,
Roles.senior,
Roles.driver,
]);
/**
* Entry point of the app.
@@ -35,19 +40,7 @@ export const App: FC = () => {
<Switch>
<Route exact path={NonAuthRoutes.home} component={LandingPage} />
<Route path={NonAuthRoutes.auth} component={AuthUser} />
<Route
path={AuthRoutes.dashboard}
render={() => (
<Personal
allowedRoles={[
Roles.admin,
Roles.operator,
Roles.senior,
Roles.driver,
]}
/>
)}
/>
<Route path={AuthRoutes.dashboard} component={All(Dashboard)} />
<Route
path={NonAuthRoutes.unauthorized}
component={Unauthorized}
Loading