Skip to content

Commit

Permalink
Make Login assets and redirects relative (#1854)
Browse files Browse the repository at this point in the history
  • Loading branch information
dvaldivia committed Apr 17, 2022
1 parent ef4587b commit 991cc09
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion portal-ui/src/ProtectedRoutes.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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) => ({
Expand Down
2 changes: 1 addition & 1 deletion portal-ui/src/Routes.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
4 changes: 2 additions & 2 deletions portal-ui/src/common/api/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -71,7 +71,7 @@ export class API {
return Promise.reject(throwMessage);
} else {
clearSession();
window.location.href = "/login";
window.location.href = "login";
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion portal-ui/src/screens/Console/Menu/Menu.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ const Menu = ({
userLoggedIn(false);
localStorage.setItem("userLoggedIn", "");
resetSession();
history.push("/login");
history.push("login");
};
api
.invoke("POST", `/api/v1/logout`)
Expand Down
2 changes: 1 addition & 1 deletion portal-ui/src/screens/LoginPage/LoginCallback.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,7 @@ const LoginCallback = ({ classes }: ILoginCallBackProps) => {
</Typography>
<Button
component={"a"}
href="/login"
href="login"
type="submit"
variant="contained"
color="primary"
Expand Down

0 comments on commit 991cc09

Please sign in to comment.