import { redirect } from '@sveltejs/kit';
import type { RequestHandler } from './$types';
import { BACKOFFICE_SESSION_COOKIE } from '$lib/server/auth';

export const POST: RequestHandler = async ({ cookies }) => {
	cookies.delete(BACKOFFICE_SESSION_COOKIE, { path: '/' });
	throw redirect(303, '/backoffice/login');
};
