Files
webshop/shop/components/logout-button.tsx
DanielS de1d228fb2
All checks were successful
Staging Build / build (push) Successful in 2m19s
feat: port all auth forms to Next.js Server Actions to avoid exposing Supabase API to the browser
2026-06-23 04:39:00 +02:00

17 lines
363 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("/auth/login");
};
return <Button onClick={logout}>Logout</Button>;
}