import type { RequestHandler } from '@sveltejs/kit';
import { clearTokens, clearBeatLeaderSession } from '$lib/server/beatleaderAuth';

export const POST: RequestHandler = async ({ url, cookies }) => {
  clearTokens(cookies);
  clearBeatLeaderSession(cookies);
  const redirectTo = url.searchParams.get('redirect_uri') ?? '/';
  return new Response(null, { status: 302, headers: { Location: redirectTo } });
};


