diff --git a/src/routes/__layout.svelte b/src/routes/__layout.svelte index 5610358..e4a550d 100644 --- a/src/routes/__layout.svelte +++ b/src/routes/__layout.svelte @@ -1,14 +1,23 @@ + + SvelteKit Auth \ No newline at end of file diff --git a/src/routes/auth/logout/index.ts b/src/routes/auth/logout/index.ts new file mode 100644 index 0000000..e097800 --- /dev/null +++ b/src/routes/auth/logout/index.ts @@ -0,0 +1,15 @@ +import type { RequestHandler } from '@sveltejs/kit' +import * as cookie from 'cookie' + +export const get: RequestHandler = async () => { + return { + status: 303, + headers: { + 'Set-Cookie': cookie.serialize('session', '', { + path: '/', + expires: new Date(0), + }), + location: '/', + }, + } +} \ No newline at end of file