Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
pterodactyl
GitHub Repository: pterodactyl/panel
Path: blob/1.0-develop/resources/scripts/routers/AuthenticationRouter.tsx
7458 views
1
import React from 'react';
2
import { Route, Switch, useRouteMatch } from 'react-router-dom';
3
import LoginContainer from '@/components/auth/LoginContainer';
4
import ForgotPasswordContainer from '@/components/auth/ForgotPasswordContainer';
5
import ResetPasswordContainer from '@/components/auth/ResetPasswordContainer';
6
import LoginCheckpointContainer from '@/components/auth/LoginCheckpointContainer';
7
import { NotFound } from '@/components/elements/ScreenBlock';
8
import { useHistory, useLocation } from 'react-router';
9
10
export default () => {
11
const history = useHistory();
12
const location = useLocation();
13
const { path } = useRouteMatch();
14
15
return (
16
<div className={'pt-8 xl:pt-32'}>
17
<Switch location={location}>
18
<Route path={`${path}/login`} component={LoginContainer} exact />
19
<Route path={`${path}/login/checkpoint`} component={LoginCheckpointContainer} />
20
<Route path={`${path}/password`} component={ForgotPasswordContainer} exact />
21
<Route path={`${path}/password/reset/:token`} component={ResetPasswordContainer} />
22
<Route path={`${path}/checkpoint`} />
23
<Route path={'*'}>
24
<NotFound onBack={() => history.push('/auth/login')} />
25
</Route>
26
</Switch>
27
</div>
28
);
29
};
30
31