SSR을 비활성화하여 SPA로 전환

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
staticandClaude Opus 5.5 committed 2026-10-11 20:49:24 +09:00
1 parent b35585c7bb
commit 35f3e92b5a
34 files changed
+152 -139

No files matched your search

+19
View File
@@ -0,0 +1,19 @@
import { redirect } from "@sveltejs/kit";
import { get } from "svelte/store";
import { clientKeyStore, masterKeyStore } from "$lib/stores";
import type { LayoutLoad } from "./$types";
export const ssr = false;
const KEYLESS_PATHS = ["/auth/login", "/key", "/client/pending"];
export const load: LayoutLoad = ({ url }) => {
if (KEYLESS_PATHS.some((path) => url.pathname.startsWith(path))) return;
const redirectQuery = `?redirect=${encodeURIComponent(url.pathname + url.search)}`;
if (!get(clientKeyStore)) {
redirect(307, "/key/generate" + redirectQuery);
} else if (!get(masterKeyStore)) {
redirect(307, "/client/pending" + redirectQuery);
}
};