From 2feb53e92f5fb57a14453451e85be82e70305954 Mon Sep 17 00:00:00 2001 From: Idan Gazit Date: Thu, 4 Jul 2024 16:33:24 +0300 Subject: [PATCH] return actions setup --- src/routes/auth/+page.server.ts | 12 ++++++++++++ src/routes/auth/+page.svelte | 7 +++++++ src/routes/{auth => direct}/+server.ts | 0 3 files changed, 19 insertions(+) create mode 100644 src/routes/auth/+page.server.ts create mode 100644 src/routes/auth/+page.svelte rename src/routes/{auth => direct}/+server.ts (100%) diff --git a/src/routes/auth/+page.server.ts b/src/routes/auth/+page.server.ts new file mode 100644 index 0000000..1f1ba28 --- /dev/null +++ b/src/routes/auth/+page.server.ts @@ -0,0 +1,12 @@ +import type { Actions } from './$types'; + +export const actions = { + login: async (event) => { + console.error("THE EVENT: ", event, event.request); + return {action: 'login'}; + }, + logout: async (event) => { + return {action: 'logout'}; + }, +} satisfies Actions; + diff --git a/src/routes/auth/+page.svelte b/src/routes/auth/+page.svelte new file mode 100644 index 0000000..0e67337 --- /dev/null +++ b/src/routes/auth/+page.svelte @@ -0,0 +1,7 @@ + + +
Form action: {form?.action}
diff --git a/src/routes/auth/+server.ts b/src/routes/direct/+server.ts similarity index 100% rename from src/routes/auth/+server.ts rename to src/routes/direct/+server.ts