Fix redirect to login base url. (#2182)
No longer needed due to baseUrl in the react router Signed-off-by: Daniel Valdivia <18384552+dvaldivia@users.noreply.github.com>
This commit is contained in:
@@ -21,7 +21,6 @@ import { ISessionResponse } from "./screens/Console/types";
|
||||
import useApi from "./screens/Console/Common/Hooks/useApi";
|
||||
import { ErrorResponseHandler } from "./common/types";
|
||||
import { ReplicationSite } from "./screens/Console/Configurations/SiteReplication/SiteReplication";
|
||||
import { baseUrl } from "./history";
|
||||
import { useSelector } from "react-redux";
|
||||
import {
|
||||
globalSetDistributedSetup,
|
||||
@@ -50,7 +49,7 @@ const ProtectedRoute = ({ Component }: ProtectedRouteProps) => {
|
||||
|
||||
const StorePathAndRedirect = () => {
|
||||
localStorage.setItem("redirect-path", pathname);
|
||||
return <Navigate to={{ pathname: `${baseUrl}login` }} />;
|
||||
return <Navigate to={{ pathname: `login` }} />;
|
||||
};
|
||||
|
||||
useEffect(() => {
|
||||
|
||||
@@ -26,8 +26,6 @@ import { AppState, useAppDispatch } from "../../../store";
|
||||
|
||||
import { ErrorResponseHandler } from "../../../common/types";
|
||||
import { clearSession } from "../../../common/utils";
|
||||
|
||||
import { baseUrl } from "../../../history";
|
||||
import api from "../../../common/api";
|
||||
|
||||
import MenuToggle from "./MenuToggle";
|
||||
@@ -107,7 +105,7 @@ const Menu = ({ classes }: IMenuProps) => {
|
||||
localStorage.setItem("userLoggedIn", "");
|
||||
localStorage.setItem("redirect-path", "");
|
||||
dispatch(resetSession());
|
||||
navigate(`${baseUrl}login`);
|
||||
navigate(`login`);
|
||||
};
|
||||
api
|
||||
.invoke("POST", `/api/v1/logout`)
|
||||
|
||||
Reference in New Issue
Block a user