summaryrefslogtreecommitdiff
path: root/src/lib/auth/components
diff options
context:
space:
mode:
authorit-fixcomart <it@fixcomart.co.id>2024-11-29 10:55:52 +0700
committerit-fixcomart <it@fixcomart.co.id>2024-11-29 10:55:52 +0700
commitac83b0ea5afd82194f38fbc913678e16a81b5c2c (patch)
tree4373da17bcb43d752b7bd888e28ba906099a19aa /src/lib/auth/components
parentc7b437cd0541cde9e2a829ec3c5689dc237505a8 (diff)
parentb4861f70338adb3960125923a7e6e4032279c88e (diff)
Merge branch 'new-release' into Feature/pengajuan-tempo
# Conflicts: # src/lib/auth/components/Menu.jsx # src/pages/my/menu.jsx
Diffstat (limited to 'src/lib/auth/components')
-rw-r--r--src/lib/auth/components/Menu.jsx14
1 files changed, 12 insertions, 2 deletions
diff --git a/src/lib/auth/components/Menu.jsx b/src/lib/auth/components/Menu.jsx
index b288eae9..18d8df91 100644
--- a/src/lib/auth/components/Menu.jsx
+++ b/src/lib/auth/components/Menu.jsx
@@ -2,12 +2,18 @@ import Link from '@/core/components/elements/Link/Link';
import { useRouter } from 'next/router';
import ImageNext from 'next/image';
import whatsappUrl from '@/core/utils/whatsappUrl';
-
+import { deleteAuth } from '@/core/utils/auth';
const Menu = () => {
const router = useRouter();
const routeStartWith = (route) => router.pathname.startsWith(route);
+ const logout = async () => {
+ deleteAuth().then(() => {
+ router.push('/login');
+ });
+ };
+
return (
<div className='grid grid-cols-1 bg-white border border-gray_r-6 rounded py-2 px-4 sticky top-48'>
<div className='mt-4 mb-1 font-medium'>Menu</div>
@@ -107,7 +113,11 @@ const Menu = () => {
<p>Profil Saya</p>
</div>
</LinkItem>
- <button type='button' className='text-gray_r-12/80 p-2 text-left'>
+ <button
+ type='button'
+ onClick={logout}
+ className='text-gray_r-12/80 p-2 text-left'
+ >
<div className='flex gap-x-3 items-center'>
<ImageNext
src='/images/icon/icon_logout.svg'