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, '/'); +};