Relative links to fix deployment to subpaths

This commit is contained in:
Markus Brueckner 2024-12-27 08:33:44 +01:00
parent 978929eb13
commit dfa45436d4
8 changed files with 14 additions and 13 deletions

View file

@ -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
});
}

View file

@ -16,7 +16,7 @@
{#each data.surveys as survey}
<li class="grid grid-cols-2">
<div>
<Link href="/survey/{survey.id}">{survey.title}</Link>
<Link href="survey/{survey.id}">{survey.title}</Link>
<span class="mr-5 inline-block">
({survey.fillRate.filled}/{survey.fillRate.expected})
{#if survey.fillRate.filled === survey.fillRate.expected}
@ -26,7 +26,7 @@
</div>
<div>
<Link
href="/survey/new?from={survey.id}"
href="survey/new?from={survey.id}"
class="ml-2 inline-block hover:bg-slate-200"
title="Duplicate survey"
aria-label="Duplicate survey"
@ -37,5 +37,5 @@
{/each}
</ul>
<Link href="/survey/new">Create a new Survey</Link>
<Link href="survey/new">Create a new Survey</Link>
</div>

View file

@ -32,7 +32,7 @@
await fetch('', {
method: 'DELETE'
});
goto('/');
goto('..');
}
</script>
@ -42,7 +42,7 @@
<HomeIcon />
</a>
<a
href="/survey/new?from={data.id}"
href="../survey/new?from={data.id}"
class="ml-2 flex items-center"
aria-label="Duplicate"
title="Duplicate"

View file

@ -49,7 +49,7 @@ export const actions = {
redirect(303, redirect_uri);
}
else {
redirect(303, '/');
redirect(303, '.');
}
}
else {

View file

@ -18,7 +18,7 @@
>
{#if data.enableRegister}
<span class="col-span-2 mt-3 justify-self-center text-xs">
<Link href="/register">Click here to register</Link>, if you do not have an account yet</span
<Link href="../register">Click here to register</Link>, if you do not have an account yet</span
>
{/if}
</form>

View file

@ -35,6 +35,6 @@ export const actions = {
sendVerificationEmail(email, result.verificationCode, getBaseUrl(event.url));
}
redirect(303, '/register/success');
redirect(303, 'register/success');
}
} satisfies Actions;

View file

@ -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 <Link href="/login">here</Link> to log in.
Click <Link href="../../login">here</Link> to log in.
{/if}
</p>

View file

@ -7,6 +7,7 @@
<Navbar title="Verification successful" />
<div>
Congratulations! You've successfully verified your account. <Link href="/login">Click here</Link> to
log in.
Congratulations! You've successfully verified your account. <Link href="../../login"
>Click here</Link
> to log in.
</div>