fix: replace window.location with router.push for client-side navigation

This commit is contained in:
Matt Van Horn 2026-04-08 00:01:30 -07:00
parent 553843ab06
commit 67ee8f4bb7
2 changed files with 5 additions and 9 deletions

View file

@ -40,19 +40,13 @@ export function UserDropdown({
await logout();
router.push("/");
router.push(getLoginPath());
router.refresh();
if (typeof window !== "undefined") {
window.location.href = getLoginPath();
}
} catch (error) {
console.error("Error during logout:", error);
await logout();
router.push("/");
router.push(getLoginPath());
router.refresh();
if (typeof window !== "undefined") {
window.location.href = getLoginPath();
}
}
};