20 lines
417 B
TypeScript
20 lines
417 B
TypeScript
import { redirect } from '@sveltejs/kit';
|
|
import { clearSessionCookie, clearLegacyCookies } from '$lib/server/session';
|
|
|
|
function signOut(event: { cookies: any }) {
|
|
clearSessionCookie(event.cookies);
|
|
clearLegacyCookies(event.cookies);
|
|
}
|
|
|
|
export function load(event) {
|
|
signOut(event);
|
|
throw redirect(303, '/');
|
|
}
|
|
|
|
export const actions = {
|
|
default: (event) => {
|
|
signOut(event);
|
|
throw redirect(303, '/');
|
|
}
|
|
};
|