import { redirect, type RequestHandler } from '@sveltejs/kit';

import { clearSession } from '$lib/server/auth';

export const POST: RequestHandler = async ({ cookies }) => {
  clearSession(cookies);
  throw redirect(303, '/');
};

export const GET: RequestHandler = async ({ cookies }) => {
  clearSession(cookies);
  throw redirect(303, '/');
};
