feat: some changes and admin
This commit is contained in:
18
nextjs/src/components/admin/LogoutButton.tsx
Normal file
18
nextjs/src/components/admin/LogoutButton.tsx
Normal file
@@ -0,0 +1,18 @@
|
||||
'use client';
|
||||
|
||||
import style from '@/styles/admin.module.scss';
|
||||
|
||||
export function LogoutButton() {
|
||||
return (
|
||||
<button
|
||||
type="button"
|
||||
className={style.btnGhost}
|
||||
onClick={async () => {
|
||||
await fetch('/api/auth/logout', { method: 'POST', credentials: 'include' });
|
||||
window.location.href = '/admin/login';
|
||||
}}
|
||||
>
|
||||
Log out
|
||||
</button>
|
||||
);
|
||||
}
|
||||
Reference in New Issue
Block a user