2025-01-02 12:16:25 +01:00

19 lines
393 B
TypeScript

'use client';
import { signOut } from 'next-auth/react';
import { useRouter } from 'next/navigation';
export default function LogoutButton() {
const router = useRouter();
return (
<button
type="button"
className="w-full rounded-md bg-indigo-500 p-3 text-white"
onClick={() => {
signOut({ callbackUrl: '/' });
}}
>
Logout
</button>
);
}