Update server setup logic and add admin user creation in setup page

This commit is contained in:
Sean Morley
2024-04-18 23:00:35 +00:00
parent 7fe90f615f
commit f626370d3f
9 changed files with 235 additions and 2 deletions

View File

@@ -4,6 +4,21 @@
import Navbar from "$lib/components/Navbar.svelte";
import type { SubmitFunction } from "@sveltejs/kit";
import "../app.css";
import { goto } from "$app/navigation";
import { onMount } from "svelte";
import { page } from "$app/stores";
let isServerSetup = data.isServerSetup;
onMount(() => {
console.log("isServerSetup", isServerSetup);
if (!isServerSetup && $page.url.pathname !== "/setup") {
goto("/setup");
}
if (isServerSetup && $page.url.pathname == "/setup") {
goto("/");
}
});
</script>
<!-- passes the user object to the navbar component -->