logout secure
This commit is contained in:
@@ -87,8 +87,10 @@ const Navbar = () => {
|
||||
if (response.ok) {
|
||||
setUser(null);
|
||||
showSuccess("Berhasil!", "Anda telah keluar dari sistem");
|
||||
// Redirect to root page after successful logout
|
||||
router.push('/');
|
||||
// Redirect to root page after successful logout - using window.location for hard redirect
|
||||
setTimeout(() => {
|
||||
window.location.href = '/';
|
||||
}, 500); // Small delay to show toast notification
|
||||
}
|
||||
} catch (error) {
|
||||
console.error('Logout error:', error);
|
||||
|
||||
Reference in New Issue
Block a user