13 lines
288 B
TypeScript
13 lines
288 B
TypeScript
import { redirect, type ServerLoad } from '@sveltejs/kit';
|
|
|
|
export const load: ServerLoad = async ({ cookies, locals }) => {
|
|
const session = cookies.get('session');
|
|
|
|
if (session) {
|
|
cookies.delete('session', { path: '/' });
|
|
}
|
|
|
|
locals.user = undefined;
|
|
|
|
throw redirect(303, '/');
|
|
};
|