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 · 19c0ff748ee94e0979c734f5fb3afeefc11ee9e1
Menu

Theme