SPB Git
382 B · 5 lines tsx
1"use client";2import { useRouter } from "next/navigation";3import { LogOut } from "lucide-react";4export function LogoutButton() { const r = useRouter(); return <button onClick={async () => { await fetch("/api/auth/logout", { method: "POST" }); r.push("/login"); r.refresh(); }} className="btn-ghost h-9 px-3 text-sm"><LogOut className="h-4 w-4" aria-hidden /> Sign out</button>; }5
Files · f05ed656dfb02e05e9363ab635689d5774c375f6
Menu

Theme