import { NextRequest, NextResponse } from 'next/server';
import { createServerClient } from '@/shared/db/supabase-client';

// --- ASA GENERATED START ---
// Route handler for auth/logout slice.
// Invalidates Supabase Auth session and redirects to login page.
// No UI — logout is triggered from existing UI (e.g., header dropdown button).
// --- ASA GENERATED END ---

// --- USER CODE START ---

export async function POST(request: NextRequest): Promise<NextResponse> {
  const supabase = createServerClient();
  await supabase.auth.signOut();

  return NextResponse.json({ success: true });
}

// --- USER CODE END ---
