feat(server): Improve server health checks and authentication flow

This commit is contained in:
cogwheel0
2025-11-26 15:25:02 +05:30
parent 9b69290589
commit 44d1cc99b4
7 changed files with 166 additions and 35 deletions

View File

@@ -81,8 +81,14 @@ class RouterNotifier extends ChangeNotifier {
final activeServer = activeServerAsync.asData?.value;
final hasActiveServer = activeServer != null;
if (!hasActiveServer) {
// Allow auth-related routes while no server configured
if (_isAuthLocation(location)) return null;
// No server configured - redirect to server connection
// Exception: allow staying on server connection or authentication pages
// But always redirect away from connection issue page (user logged out)
if (location == Routes.serverConnection ||
location == Routes.authentication ||
location == Routes.login) {
return null;
}
return Routes.serverConnection;
}