From dfa45436d4215c7fe3c326abcbc8a2a4a636c7d7 Mon Sep 17 00:00:00 2001
From: Markus Brueckner
Date: Fri, 27 Dec 2024 08:33:44 +0100
Subject: [PATCH] Relative links to fix deployment to subpaths
---
src/lib/session/session.ts | 4 ++--
src/routes/(app)/+page.svelte | 6 +++---
src/routes/(app)/survey/[surveyId]/+page.svelte | 4 ++--
src/routes/login/+page.server.ts | 2 +-
src/routes/login/+page.svelte | 2 +-
src/routes/register/+page.server.ts | 2 +-
src/routes/register/success/+page.svelte | 2 +-
src/routes/verify/[verificationCode]/+page.svelte | 5 +++--
8 files changed, 14 insertions(+), 13 deletions(-)
diff --git a/src/lib/session/session.ts b/src/lib/session/session.ts
index 5067889..0856240 100644
--- a/src/lib/session/session.ts
+++ b/src/lib/session/session.ts
@@ -37,7 +37,7 @@ export function setSessionTokenCookie(event: RequestEvent, token: string, expire
httpOnly: true,
sameSite: "lax",
expires: expiresAt,
- path: "/"
+ path: "/" // TODO this should be limited to the path the application is running on
});
}
@@ -46,6 +46,6 @@ export function deleteSessionTokenCookie(event: RequestEvent): void {
httpOnly: true,
sameSite: "lax",
maxAge: 0,
- path: "/"
+ path: "/" // TODO this should be limited to the path the application is running on
});
}
diff --git a/src/routes/(app)/+page.svelte b/src/routes/(app)/+page.svelte
index 1011250..02cf00f 100644
--- a/src/routes/(app)/+page.svelte
+++ b/src/routes/(app)/+page.svelte
@@ -16,7 +16,7 @@
{#each data.surveys as survey}
- {survey.title}
+ {survey.title}
({survey.fillRate.filled}/{survey.fillRate.expected})
{#if survey.fillRate.filled === survey.fillRate.expected}
@@ -26,7 +26,7 @@
- Create a new Survey
+ Create a new Survey
diff --git a/src/routes/(app)/survey/[surveyId]/+page.svelte b/src/routes/(app)/survey/[surveyId]/+page.svelte
index a55d07c..52f43d4 100644
--- a/src/routes/(app)/survey/[surveyId]/+page.svelte
+++ b/src/routes/(app)/survey/[surveyId]/+page.svelte
@@ -32,7 +32,7 @@
await fetch('', {
method: 'DELETE'
});
- goto('/');
+ goto('..');
}
@@ -42,7 +42,7 @@
{#if data.enableRegister}
- Click here to register, if you do not have an account yet Click here to register, if you do not have an account yet
{/if}
diff --git a/src/routes/register/+page.server.ts b/src/routes/register/+page.server.ts
index 6b2d357..1bf623b 100644
--- a/src/routes/register/+page.server.ts
+++ b/src/routes/register/+page.server.ts
@@ -35,6 +35,6 @@ export const actions = {
sendVerificationEmail(email, result.verificationCode, getBaseUrl(event.url));
}
- redirect(303, '/register/success');
+ redirect(303, 'register/success');
}
} satisfies Actions;
\ No newline at end of file
diff --git a/src/routes/register/success/+page.svelte b/src/routes/register/success/+page.svelte
index e42028b..21e1a1b 100644
--- a/src/routes/register/success/+page.svelte
+++ b/src/routes/register/success/+page.svelte
@@ -12,6 +12,6 @@
An email has been sent to your email address to activate the account. Please follow the
instructions in the email to be able to log in.
{:else}
- Click here to log in.
+ Click here to log in.
{/if}
diff --git a/src/routes/verify/[verificationCode]/+page.svelte b/src/routes/verify/[verificationCode]/+page.svelte
index f45b359..bdc4599 100644
--- a/src/routes/verify/[verificationCode]/+page.svelte
+++ b/src/routes/verify/[verificationCode]/+page.svelte
@@ -7,6 +7,7 @@
- Congratulations! You've successfully verified your account. Click here to
- log in.
+ Congratulations! You've successfully verified your account. Click here to log in.