From f7fd63dff9ac7cdb99984f158b7d7fea4d0630e7 Mon Sep 17 00:00:00 2001 From: Charles Morgan Date: Sun, 11 Oct 2020 18:38:09 -0400 Subject: [PATCH] Remove trailing slash if one is present Closes https://github.com/pterodactyl/panel/issues/2386 --- resources/scripts/routers/AuthenticationRouter.tsx | 3 ++- resources/scripts/routers/DashboardRouter.tsx | 3 ++- resources/scripts/routers/ServerRouter.tsx | 3 ++- 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/resources/scripts/routers/AuthenticationRouter.tsx b/resources/scripts/routers/AuthenticationRouter.tsx index 57d1422ca..baa662a85 100644 --- a/resources/scripts/routers/AuthenticationRouter.tsx +++ b/resources/scripts/routers/AuthenticationRouter.tsx @@ -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 (
+ diff --git a/resources/scripts/routers/DashboardRouter.tsx b/resources/scripts/routers/DashboardRouter.tsx index 7a895a7e4..f68bda865 100644 --- a/resources/scripts/routers/DashboardRouter.tsx +++ b/resources/scripts/routers/DashboardRouter.tsx @@ -1,6 +1,6 @@ import React, { useEffect } from 'react'; import ReactGA from 'react-ga'; -import { NavLink, Route, RouteComponentProps, Switch } from 'react-router-dom'; +import { NavLink, Route, RouteComponentProps, Switch, Redirect } from 'react-router-dom'; import AccountOverviewContainer from '@/components/dashboard/AccountOverviewContainer'; import NavigationBar from '@/components/NavigationBar'; import DashboardContainer from '@/components/dashboard/DashboardContainer'; @@ -27,6 +27,7 @@ export default ({ location }: RouteComponentProps) => { } + diff --git a/resources/scripts/routers/ServerRouter.tsx b/resources/scripts/routers/ServerRouter.tsx index a90ff652b..e35113dca 100644 --- a/resources/scripts/routers/ServerRouter.tsx +++ b/resources/scripts/routers/ServerRouter.tsx @@ -1,6 +1,6 @@ import React, { useEffect, useState } from 'react'; import ReactGA from 'react-ga'; -import { NavLink, Route, RouteComponentProps, Switch } from 'react-router-dom'; +import { NavLink, Route, RouteComponentProps, Switch, Redirect } from 'react-router-dom'; import NavigationBar from '@/components/NavigationBar'; import ServerConsole from '@/components/server/ServerConsole'; import TransitionRouter from '@/TransitionRouter'; @@ -123,6 +123,7 @@ const ServerRouter = ({ match, location }: RouteComponentProps<{ id: string }>) <> +