import { redirect } from 'next/navigation';

interface LoginPageProps {
  searchParams: Promise<{ error?: string }>;
}

/** Alias for `/` so OAuth error redirects to `/login?error=…` keep working. */
export default async function LoginPage({ searchParams }: LoginPageProps) {
  const { error } = await searchParams;
  const target = error ? `/?error=${encodeURIComponent(error)}` : '/';
  redirect(target);
}
