Files
webshop/shop/components/logout-button.tsx
2026-06-24 01:40:17 +02:00

18 lines
375 B
TypeScript

"use client";
import { signOut } from "@/lib/actions/auth";
import { Button } from "@/components/ui/button";
import { useRouter } from "next/navigation";
export function LogoutButton() {
const router = useRouter();
const logout = async () => {
await signOut();
router.push("/");
router.refresh();
};
return <Button onClick={logout}>Logout</Button>;
}