import { requireSession } from "@/lib/auth";
import { readPasskeys } from "@/lib/auth-store";
import PasskeyList from "./passkey-list";

export default async function PasskeysPage() {
  const session = await requireSession();
  const list = await readPasskeys(session.username);
  const visible = list.map(({ publicKey: _pk, ...rest }) => rest);
  return <PasskeyList initial={visible} username={session.username} />;
}

export const dynamic = "force-dynamic";
