MCPcopy Create free account
hub / github.com/9d8dev/directory / handleLogout

Function handleLogout

components/admin/admin-header.tsx:9–22  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

7 const router = useRouter();
8
9 const handleLogout = async () => {
10 try {
11 const response = await fetch("/api/admin/logout", {
12 method: "POST",
13 });
14
15 if (response.ok) {
16 router.push("/admin/login");
17 router.refresh();
18 }
19 } catch (error) {
20 console.error("Logout error:", error);
21 }
22 };
23
24 return (
25 <header className="bg-white shadow-sm">

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected