import type { RequestHandler } from './$types'; import { redirect } from '@sveltejs/kit'; import { dev } from '$app/environment'; export const POST: RequestHandler = async ({ cookies }) => { // Clear the authentication cookie using the new API cookies.set('chef_bible_auth', '', { path: '/', httpOnly: true, sameSite: 'lax', // Changed from 'strict' to 'lax' for mobile Safari compatibility secure: !dev, // Secure in production, not secure in development maxAge: 0 // Expire immediately }); // Redirect to home page throw redirect(302, '/'); }; export const GET: RequestHandler = async ({ cookies }) => { // Clear the authentication cookie using the new API cookies.set('chef_bible_auth', '', { path: '/', httpOnly: true, sameSite: 'lax', // Changed from 'strict' to 'lax' for mobile Safari compatibility secure: !dev, // Secure in production, not secure in development maxAge: 0 // Expire immediately }); // Redirect to home page throw redirect(302, '/'); };