From e13b99a34a204613b9c626b9268b65ea370e7f10 Mon Sep 17 00:00:00 2001 From: Muhammad Fajar Date: Wed, 7 Dec 2022 02:46:24 +0700 Subject: [PATCH] fix login & logout again --- frontend/client-portal/src/contexts/LaravelAuthContext.tsx | 3 --- .../src/layouts/dashboard/header/AccountPopover.tsx | 2 +- .../client-portal/src/sections/auth/login/VerifyCodeForm.tsx | 3 +++ 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/frontend/client-portal/src/contexts/LaravelAuthContext.tsx b/frontend/client-portal/src/contexts/LaravelAuthContext.tsx index 7c09b5fa..896cc131 100755 --- a/frontend/client-portal/src/contexts/LaravelAuthContext.tsx +++ b/frontend/client-portal/src/contexts/LaravelAuthContext.tsx @@ -144,9 +144,6 @@ function AuthProvider({ children }: AuthProviderProps) { const logout = () => { setSession(null); - localStorage.removeItem('loginOrVerifyCode'); - localStorage.removeItem('emailOrPhone'); - localStorage.removeItem('emailOrPhoneForm'); dispatch({ type: Types.Logout }); }; diff --git a/frontend/client-portal/src/layouts/dashboard/header/AccountPopover.tsx b/frontend/client-portal/src/layouts/dashboard/header/AccountPopover.tsx index e9a01e1c..64bb2e33 100755 --- a/frontend/client-portal/src/layouts/dashboard/header/AccountPopover.tsx +++ b/frontend/client-portal/src/layouts/dashboard/header/AccountPopover.tsx @@ -45,7 +45,7 @@ export default function AccountPopover() { const handleLogout = () => { logout(); navigate('/auth/login'); - enqueueSnackbar('Berhasi Logout!', 'success'); + enqueueSnackbar('Logout Berhasil!', { variant: 'success' }); }; return ( diff --git a/frontend/client-portal/src/sections/auth/login/VerifyCodeForm.tsx b/frontend/client-portal/src/sections/auth/login/VerifyCodeForm.tsx index a84d76f7..7580971d 100755 --- a/frontend/client-portal/src/sections/auth/login/VerifyCodeForm.tsx +++ b/frontend/client-portal/src/sections/auth/login/VerifyCodeForm.tsx @@ -103,6 +103,9 @@ export default function VerifyCodeForm({ navigate('/dashboard'); enqueueSnackbar('Login Berhasil!', { variant: 'success' }); + localStorage.removeItem('loginOrVerifyCode'); + localStorage.removeItem('emailOrPhone'); + localStorage.removeItem('emailOrPhoneForm'); }; const handleChangeWithNextField = (