From a925fd70f56f91a544e13ec468cf202c5be1824d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Roman=20Kr=C4=8Dek?= Date: Sun, 22 Jun 2025 16:16:07 +0200 Subject: [PATCH] signout route --- src/routes/auth/signout/+server.ts | 10 ++++++++++ 1 file changed, 10 insertions(+) create mode 100644 src/routes/auth/signout/+server.ts diff --git a/src/routes/auth/signout/+server.ts b/src/routes/auth/signout/+server.ts new file mode 100644 index 0000000..cf49ff6 --- /dev/null +++ b/src/routes/auth/signout/+server.ts @@ -0,0 +1,10 @@ +import type { RequestHandler } from './$types'; +import { redirect } from '@sveltejs/kit'; + +export const GET: RequestHandler = async ({ locals }) => { + // If using supabase-js client on the server, you can sign out here + if (locals.supabase) { + await locals.supabase.auth.signOut(); + } + throw redirect(303, '/'); +};