Remove trailing slash if one is present

Closes https://github.com/pterodactyl/panel/issues/2386
This commit is contained in:
Charles Morgan 2020-10-11 18:38:09 -04:00
parent 08dcb85e5d
commit f7fd63dff9
No known key found for this signature in database
GPG key ID: D71946CD723249BD
3 changed files with 6 additions and 3 deletions

View file

@ -1,6 +1,6 @@
import React, { useEffect } from 'react';
import ReactGA from 'react-ga';
import { Route, RouteComponentProps, Switch } from 'react-router-dom';
import { Route, RouteComponentProps, Switch, Redirect } from 'react-router-dom';
import LoginContainer from '@/components/auth/LoginContainer';
import ForgotPasswordContainer from '@/components/auth/ForgotPasswordContainer';
import ResetPasswordContainer from '@/components/auth/ResetPasswordContainer';
@ -15,6 +15,7 @@ export default ({ location, history, match }: RouteComponentProps) => {
return (
<div className={'pt-8 xl:pt-32'}>
<Switch location={location}>
<Redirect from="/:url*(/+)" to={location.pathname.slice(0, -1)} />
<Route path={`${match.path}/login`} component={LoginContainer} exact/>
<Route path={`${match.path}/login/checkpoint`} component={LoginCheckpointContainer}/>
<Route path={`${match.path}/password`} component={ForgotPasswordContainer} exact/>