From ea8496b85a593d0ebe23f3c75e156bb098a3048d Mon Sep 17 00:00:00 2001 From: AlexBocken Date: Sun, 23 Jul 2023 15:39:20 +0200 Subject: [PATCH] slightly improve logout --- src/routes/(main)/logout/+page.server.ts | 13 +++++++------ src/routes/(main)/logout/+page.svelte | 15 +++++---------- 2 files changed, 12 insertions(+), 16 deletions(-) diff --git a/src/routes/(main)/logout/+page.server.ts b/src/routes/(main)/logout/+page.server.ts index 886a7be..7184399 100644 --- a/src/routes/(main)/logout/+page.server.ts +++ b/src/routes/(main)/logout/+page.server.ts @@ -1,7 +1,8 @@ -import { redirect } from "@sveltejs/kit" -import type { Actions, PageServerLoad } from "./$types" +import redirect from "@sveltejs/kit" +import type { Actions } from './$types'; -export const load: PageServerLoad = async ({ cookies }) => { - cookies.delete("UserSession") - redirect(303, "/") -} +export const actions: Actions = { + default: async ({cookies}) => { + cookies.delete("UserSession") + } +} satisfies Actions; diff --git a/src/routes/(main)/logout/+page.svelte b/src/routes/(main)/logout/+page.svelte index 7560511..61da226 100644 --- a/src/routes/(main)/logout/+page.svelte +++ b/src/routes/(main)/logout/+page.svelte @@ -1,12 +1,7 @@ -

Log Out

+
+

Log out

+ +