Skip to content

Commit

Permalink
fix: some frontend stuff
Browse files Browse the repository at this point in the history
Signed-off-by: Jan Lauber <jan.lauber@protonmail.ch>
  • Loading branch information
janlauber committed Jun 18, 2023
1 parent bb9ed8b commit 48d7cb0
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 6 deletions.
6 changes: 0 additions & 6 deletions kubelab-ui/src/lib/components/base/Nav.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -28,12 +28,6 @@
href: "/labs",
icon: TerminalSquare
},
{
id: "3",
name: "Docs",
href: "/docs",
icon: ScrollText
}
];
</script>

Expand Down
12 changes: 12 additions & 0 deletions kubelab-ui/src/routes/+layout.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,18 @@ export const load = ({ url }) => {
}
} else {
if (pathname !== "/login/") {
client.authStore.clear();
throw redirect(307, "/login/");
}
}

if(client.authStore.isValid) {
if (pathname === "/login/") {
throw redirect(307, "/");
}
} else {
if (pathname !== "/login/") {
client.authStore.clear();
throw redirect(307, "/login/");
}
}
Expand Down

0 comments on commit 48d7cb0

Please sign in to comment.