update clear all localStorage data on logout
This commit is contained in:
@@ -1,12 +1,13 @@
|
|||||||
const handleLogOut = (navigate) => {
|
const handleLogOut = (navigate) => {
|
||||||
localStorage.removeItem('Auth');
|
// Hapus semua data localStorage
|
||||||
localStorage.removeItem('session');
|
localStorage.clear();
|
||||||
|
|
||||||
if (navigate) {
|
// Redirect ke halaman signin
|
||||||
navigate('/signin', { replace: true });
|
if (navigate) {
|
||||||
} else {
|
navigate('/signin', { replace: true });
|
||||||
window.location.replace('/signin');
|
} else {
|
||||||
}
|
window.location.replace('/signin');
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
export default handleLogOut;
|
export default handleLogOut;
|
||||||
|
|||||||
Reference in New Issue
Block a user