mirror of
https://github.com/vercel/commerce.git
synced 2025-06-28 01:11:24 +00:00
19 lines
393 B
TypeScript
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>
|
|
);
|
|
}
|