fix: redirect to /auth/login after logout and handle UNAUTHORIZED errors on user pages

- Change router.refresh() to router.push('/auth/login') after credentials logout
  so users land on the login page instead of the broken current page
- Chain catchTrpcUnauthorized after catchTrpcNotFound in /manage/users/[userId]
  layout and security page so unauthenticated API responses redirect to login
  instead of crashing with a server error
This commit is contained in:
copilot-swe-agent[bot] authored and GitHub committed 2026-05-29 21:01:39 +00:00
1 parent 739da59e45
commit ef91430b46
3 files changed
+6 -5

No files matched your search

@@ -45,7 +45,7 @@ export const UserAvatarMenu = ({ children, availableUpdatesPromise }: UserAvatar
window.location.assign(logoutUrl);
return;
}
router.refresh();
router.push("/auth/login");
},
});
}, [logoutUrl, openModal, router]);