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