use hard navigation on login and logout to clear state

This commit is contained in:
CREDO23 2026-01-07 18:13:31 +02:00
parent 348898b08b
commit 5151ba381e
2 changed files with 19 additions and 53 deletions

View file

@ -34,14 +34,14 @@ export function UserDropdown({
if (typeof window !== "undefined") {
localStorage.removeItem("surfsense_bearer_token");
router.push("/");
window.location.href = "/";
}
} catch (error) {
console.error("Error during logout:", error);
// Optionally, provide user feedback
if (typeof window !== "undefined") {
alert("Logout failed. Please try again.");
router.push("/");
window.location.href = "/";
}
}
};