import { signOutAction } from "@/actions/auth-actions";

/**
 * Server component that signs the current user out and redirects to
 * `/login`. The action is invoked immediately during render so there
 * is no `fetch` inside a client-side `useEffect` to satisfy the
 * `no-fetch-in-effect` lint rule, and no client-side race between
 * sign-out and redirect.
 */
export default async function LogoutPage() {
  await signOutAction();
  // signOutAction calls `redirect("/login")` itself, so this
  // unreachable return is only there to satisfy the type checker.
  return null;
}
