Make Login assets and redirects relative (#1854)

This commit is contained in:
Daniel Valdivia
2022-04-16 22:05:53 -07:00
committed by GitHub
parent ef4587b596
commit 991cc0953e
5 changed files with 6 additions and 6 deletions

View File

@@ -72,7 +72,7 @@ const ProtectedRoute = ({
return null;
}
// redirect user to the right page based on session status
return loggedIn ? <Component /> : <Redirect to={{ pathname: "/login" }} />;
return loggedIn ? <Component /> : <Redirect to={{ pathname: "login" }} />;
};
const mapState = (state: AppState) => ({

View File

@@ -46,7 +46,7 @@ const Routes = () => {
children={(routerProps) => (
<div
style={{
backgroundImage: `url('/images/background-wave-orig2.svg'), url('/images/background.svg')`,
backgroundImage: `url('images/background-wave-orig2.svg'), url('images/background.svg')`,
backgroundPosition: "center 250px, center center",
backgroundRepeat: "no-repeat",
backgroundSize: "2547px 980px,cover",

View File

@@ -37,7 +37,7 @@ export class API {
clearSession();
// Refresh the whole page to ensure cache is clear
// and we dont end on an infinite loop
window.location.href = "/login";
window.location.href = "login";
return;
}
return this.onError(err);
@@ -71,7 +71,7 @@ export class API {
return Promise.reject(throwMessage);
} else {
clearSession();
window.location.href = "/login";
window.location.href = "login";
}
}
}

View File

@@ -107,7 +107,7 @@ const Menu = ({
userLoggedIn(false);
localStorage.setItem("userLoggedIn", "");
resetSession();
history.push("/login");
history.push("login");
};
api
.invoke("POST", `/api/v1/logout`)

View File

@@ -175,7 +175,7 @@ const LoginCallback = ({ classes }: ILoginCallBackProps) => {
</Typography>
<Button
component={"a"}
href="/login"
href="login"
type="submit"
variant="contained"
color="primary"