yo-next-auth/app/[locale]/(protected)/cabinet/page.tsx
2024-04-26 22:16:21 +03:00

20 lines
382 B
TypeScript

import { auth, signOut } from '@/config/auth'
const CabinetPage = async () => {
const session = await auth()
return (
<div>
{JSON.stringify(session)}
<form action={async () => {
'use server'
await signOut()
}}>
<button type="submit">SignOut {session?.user.role}</button>
</form>
</div>
)
}
export default CabinetPage