summaryrefslogtreecommitdiff
path: root/src/pages/my/menu.jsx
diff options
context:
space:
mode:
Diffstat (limited to 'src/pages/my/menu.jsx')
-rw-r--r--src/pages/my/menu.jsx9
1 files changed, 6 insertions, 3 deletions
diff --git a/src/pages/my/menu.jsx b/src/pages/my/menu.jsx
index c8e1e7e9..fb8e6b03 100644
--- a/src/pages/my/menu.jsx
+++ b/src/pages/my/menu.jsx
@@ -5,15 +5,18 @@ import useAuth from '@/core/hooks/useAuth'
import { deleteAuth } from '@/core/utils/auth'
import IsAuth from '@/lib/auth/components/IsAuth'
import { ChevronRightIcon, UserIcon } from '@heroicons/react/24/solid'
+import { signOut, useSession } from 'next-auth/react'
import { useRouter } from 'next/router'
export default function Menu() {
const auth = useAuth()
const router = useRouter()
+ const { data: session } = useSession()
const logout = () => {
- deleteAuth()
- router.push('/login')
+ deleteAuth().then(() => {
+ router.push('/login')
+ })
}
return (
@@ -62,7 +65,7 @@ export default function Menu() {
<LinkItem href='/my/address'>Daftar Alamat</LinkItem>
</div>
- <div onClick={logout} className='p-4 mt-2'>
+ <div onClick={() => logout()} className='p-4 mt-2'>
<button className='w-full btn-red'>Keluar Akun</button>
</div>
</div>