"use client"; /** * Default flow: a plain anchor to `/api/auth/signout` (overridable via * the `signoutPath` prop). The route handler runs RP-initiated logout * in a single redirect — kills the NextAuth cookie, ends the Keycloak * SSO session, lands on the app's signed-out page. * * Apps with a different shape (no `/api/auth/signout`, need to fire * custom telemetry, etc.) pass `onSignOut` to replace the navigation * with a button + custom handler. */ type LogoutButtonProps = { label: string; signoutPath?: string; onSignOut?: () => void | Promise; }; export function LogoutButton({ label, signoutPath = "/api/auth/signout", onSignOut, }: LogoutButtonProps) { if (onSignOut) { return ( ); } return ( {label} ); }