Root cause: LoginViewModel.logout() was async (viewModelScope.launch), so _uiState.isConnected remained true after navigating to login. LoginScreen's LaunchedEffect immediately navigated back to dashboard, where APIs failed with 401 again → infinite loop. Fixes: - SessionManager: add _invalidating flag to prevent concurrent 401 handling - AuthInterceptor: check isSessionValid before invalidating - LoginViewModel: update _uiState synchronously in logout(), clear token before launching coroutine for prefs.clear() - LoginViewModel: call SessionManager.restoreSession() after successful login - MainActivity: remove restoreSession() from logout handler (was incorrectly re-validating session right after invalidation) Bump to v1.7.1 (versionCode 10)
20 MiB
20 MiB
The file is too large to be shown.
View Raw