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

Implement basic NotAuth and NotFound page

	geändert:       src/App.tsx
parent 1845d29b
No related branches found
No related tags found
1 merge request!24Implement mock Private route basing on user role
...@@ -5,7 +5,9 @@ import { AuthUser } from 'components/AuthUser/AuthUser'; ...@@ -5,7 +5,9 @@ import { AuthUser } from 'components/AuthUser/AuthUser';
import { LandingPage } from 'components/LandingPage/LandingPage'; import { LandingPage } from 'components/LandingPage/LandingPage';
import { PrivateRoute } from 'components/api/PrivateRoute/PrivateRoute'; import { PrivateRoute } from 'components/api/PrivateRoute/PrivateRoute';
import { AuthRoutes, NonAuthRoutes } from 'components/api/routes'; import { AuthRoutes, NonAuthRoutes } from 'components/api/routes';
import { NotFound } from 'components/NotFound/NotFound';
import { Roles } from 'components/api/userRoles'; import { Roles } from 'components/api/userRoles';
import { Unauthorized } from 'components/Unauthorized/Unauthorized';
export const App: FC = () => ( export const App: FC = () => (
<Router> <Router>
...@@ -18,6 +20,8 @@ export const App: FC = () => ( ...@@ -18,6 +20,8 @@ export const App: FC = () => (
Component={HomePage} Component={HomePage}
requiredRoles={[Roles.admin, Roles.operator, Roles.senior]} requiredRoles={[Roles.admin, Roles.operator, Roles.senior]}
/> />
<Route path={NonAuthRoutes.unauthorized} component={Unauthorized} />
<Route component={NotFound} />
</Switch> </Switch>
</div> </div>
</Router> </Router>
......
import React, { FC } from 'react';
export const NotFound: FC = () => <h1>Page not found</h1>;
import React, { FC } from 'react';
export const Unauthorized: FC = () => <h1>You cannot access this page</h1>;
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