From 40a02925c4882e1af7fde47627af7e82b19146ee Mon Sep 17 00:00:00 2001 From: liyunze <50455574+liyunze-coding@users.noreply.github.com> Date: Fri, 18 Sep 2026 16:19:16 +0800 Subject: [PATCH] added terms and conditions, privacy policy and fixed redirecting to login when logged in --- src/lib/paths.ts | 6 ++ src/routes/+layout.svelte | 4 + src/routes/auth/+layout.svelte | 35 ++++++++ src/routes/auth/login/+page.svelte | 9 ++ src/routes/privacy/+page.svelte | 130 +++++++++++++++++++++++++++++ src/routes/terms/+page.svelte | 129 ++++++++++++++++++++++++++++ 6 files changed, 313 insertions(+) create mode 100644 src/routes/auth/+layout.svelte create mode 100644 src/routes/privacy/+page.svelte create mode 100644 src/routes/terms/+page.svelte diff --git a/src/lib/paths.ts b/src/lib/paths.ts index 6fbdc75..128092c 100644 --- a/src/lib/paths.ts +++ b/src/lib/paths.ts @@ -19,6 +19,8 @@ const APP_SECTIONS = new Set([ "admin", "auth", "post", + "privacy", + "terms", ]); export function toAppPath(href: string, origin?: string): string | null { @@ -89,6 +91,10 @@ export function appPathLabel(appPath: string, titles?: Record): return "Sign in"; case "post": return rest === "question" ? "New question" : "New note"; + case "privacy": + return "Privacy policy"; + case "terms": + return "Terms"; default: return rest ? `${head} post` : head; } diff --git a/src/routes/+layout.svelte b/src/routes/+layout.svelte index 468e9f9..f9d2b3d 100644 --- a/src/routes/+layout.svelte +++ b/src/routes/+layout.svelte @@ -43,6 +43,10 @@ DSEC Notebook is a community resource for Deakin University students. Not affiliated with Deakin University.

+ diff --git a/src/routes/auth/+layout.svelte b/src/routes/auth/+layout.svelte new file mode 100644 index 0000000..a41b42c --- /dev/null +++ b/src/routes/auth/+layout.svelte @@ -0,0 +1,35 @@ + + +{#if ready} + {@render children()} +{:else} +
+

Loading

+
+{/if} diff --git a/src/routes/auth/login/+page.svelte b/src/routes/auth/login/+page.svelte index 31d67e7..3539994 100644 --- a/src/routes/auth/login/+page.svelte +++ b/src/routes/auth/login/+page.svelte @@ -242,6 +242,15 @@ {loading ? "Sending code..." : "Send verification code"} +

+ By creating an account you agree to the + Terms + and + Privacy policy. +

+