Skip to content
Snippets Groups Projects
Verified Commit d3a527bb authored by Defendi Alberto's avatar Defendi Alberto
Browse files

Apply new Authorization.

parent 79f3c8b8
No related branches found
No related tags found
2 merge requests!56Refined auth flow and new website pages.,!53Feature/authorization/curry
Pipeline #12402 failed
......@@ -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}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment