refactor(auth): Preserve server configs during logout for seamless re-login

This commit is contained in:
cogwheel0
2025-12-07 10:05:55 +05:30
parent 13b0b6345a
commit 218d061eae
3 changed files with 22 additions and 22 deletions

View File

@@ -145,7 +145,10 @@ class RouterNotifier extends ChangeNotifier {
return location == Routes.splash ? null : Routes.splash;
case AuthNavigationState.needsLogin:
if (location == Routes.connectionIssue) return null;
return null;
// Redirect to authentication page if not already on an auth route
// This handles the post-logout case where we want sign-in, not server setup
if (_isAuthLocation(location)) return null;
return Routes.authentication;
case AuthNavigationState.error:
final authSnapshot = ref
.read(authStateManagerProvider)