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