2024-12-29 15:02:58 +01:00

20 lines
420 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>
);
}