fix: 401 logout loop — sync state update, prevent re-navigation
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)
This commit is contained in:
@@ -12,8 +12,8 @@ android {
|
||||
applicationId = "com.devlab.app"
|
||||
minSdk = 26
|
||||
targetSdk = 37
|
||||
versionCode = 9
|
||||
versionName = "1.7.0"
|
||||
versionCode = 10
|
||||
versionName = "1.7.1"
|
||||
}
|
||||
|
||||
buildTypes {
|
||||
|
||||
Reference in New Issue
Block a user