forked from pterodactyl/panel
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathAuthenticationRouter.tsx
More file actions
29 lines (27 loc) · 1.32 KB
/
AuthenticationRouter.tsx
File metadata and controls
29 lines (27 loc) · 1.32 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
import React from 'react';
import { Route, Switch, useRouteMatch } from 'react-router-dom';
import LoginContainer from '@/components/auth/LoginContainer';
import ForgotPasswordContainer from '@/components/auth/ForgotPasswordContainer';
import ResetPasswordContainer from '@/components/auth/ResetPasswordContainer';
import LoginCheckpointContainer from '@/components/auth/LoginCheckpointContainer';
import { NotFound } from '@/components/elements/ScreenBlock';
import { useHistory, useLocation } from 'react-router';
export default () => {
const history = useHistory();
const location = useLocation();
const { path } = useRouteMatch();
return (
<div className={'pt-8 xl:pt-32'}>
<Switch location={location}>
<Route path={`${path}/login`} component={LoginContainer} exact/>
<Route path={`${path}/login/checkpoint`} component={LoginCheckpointContainer}/>
<Route path={`${path}/password`} component={ForgotPasswordContainer} exact/>
<Route path={`${path}/password/reset/:token`} component={ResetPasswordContainer}/>
<Route path={`${path}/checkpoint`}/>
<Route path={'*'}>
<NotFound onBack={() => history.push('/auth/login')}/>
</Route>
</Switch>
</div>
);
};