paolosantarsiero aac4af90ae fix: build
2024-12-31 11:37:43 +01:00

20 lines
421 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({ redirect: false });
router.replace('/');
}}
>
Logout
</button>
);
}