From 01e86fb4a54b801a9b8124455611c312e5de4af0 Mon Sep 17 00:00:00 2001
From: "HATEC\\SPVDEV001" <tri.susilo@altama.co.id>
Date: Mon, 14 Aug 2023 15:04:45 +0700
Subject: google sign in

---
 src/pages/my/menu.jsx | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

(limited to 'src/pages/my/menu.jsx')

diff --git a/src/pages/my/menu.jsx b/src/pages/my/menu.jsx
index c8e1e7e9..bd20e2eb 100644
--- a/src/pages/my/menu.jsx
+++ b/src/pages/my/menu.jsx
@@ -5,11 +5,13 @@ 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()
@@ -62,7 +64,7 @@ export default function Menu() {
               <LinkItem href='/my/address'>Daftar Alamat</LinkItem>
             </div>
 
-            <div onClick={logout} className='p-4 mt-2'>
+            <div onClick={() => (logout, signOut)} className='p-4 mt-2'>
               <button className='w-full btn-red'>Keluar Akun</button>
             </div>
           </div>
-- 
cgit v1.2.3


From f01f28a7eac76c6da5bf857bfc80fd347586ce7f Mon Sep 17 00:00:00 2001
From: "HATEC\\SPVDEV001" <tri.susilo@altama.co.id>
Date: Wed, 16 Aug 2023 09:39:47 +0700
Subject: register google

---
 src/pages/my/menu.jsx | 9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)

(limited to 'src/pages/my/menu.jsx')

diff --git a/src/pages/my/menu.jsx b/src/pages/my/menu.jsx
index bd20e2eb..fb8e6b03 100644
--- a/src/pages/my/menu.jsx
+++ b/src/pages/my/menu.jsx
@@ -11,11 +11,12 @@ import { useRouter } from 'next/router'
 export default function Menu() {
   const auth = useAuth()
   const router = useRouter()
-  const {data : session} = useSession()
+  const { data: session } = useSession()
 
   const logout = () => {
-    deleteAuth()
-    router.push('/login')
+    deleteAuth().then(() => {
+      router.push('/login')
+    })
   }
 
   return (
@@ -64,7 +65,7 @@ export default function Menu() {
               <LinkItem href='/my/address'>Daftar Alamat</LinkItem>
             </div>
 
-            <div onClick={() => (logout, signOut)} className='p-4 mt-2'>
+            <div onClick={() => logout()} className='p-4 mt-2'>
               <button className='w-full btn-red'>Keluar Akun</button>
             </div>
           </div>
-- 
cgit v1.2.3

