mirror of
https://github.com/KevinMidboe/immich.git
synced 2025-10-29 17:40:28 +00:00
fix(mobile): user get logged out upon clicking on any thing after logging in (#1808)
* fix(mobile): user get logged out upon clicking on any thing after logging in * wip: fixing still * fix: the actual issue * Fix: avaialble album not updating UI
This commit is contained in:
@@ -92,20 +92,25 @@ class AuthenticationNotifier extends StateNotifier<AuthenticationState> {
|
||||
}
|
||||
|
||||
Future<bool> logout() async {
|
||||
await Future.wait([
|
||||
_apiService.authenticationApi.logout(),
|
||||
Hive.box(userInfoBox).delete(accessTokenKey),
|
||||
Store.delete(StoreKey.assetETag),
|
||||
Store.delete(StoreKey.userRemoteId),
|
||||
_assetCacheService.invalidate(),
|
||||
_albumCacheService.invalidate(),
|
||||
_sharedAlbumCacheService.invalidate(),
|
||||
Hive.box<HiveSavedLoginInfo>(hiveLoginInfoBox).delete(savedLoginInfoKey)
|
||||
]);
|
||||
try {
|
||||
await Future.wait([
|
||||
_apiService.authenticationApi.logout(),
|
||||
Hive.box(userInfoBox).delete(accessTokenKey),
|
||||
Store.delete(StoreKey.assetETag),
|
||||
Store.delete(StoreKey.userRemoteId),
|
||||
_assetCacheService.invalidate(),
|
||||
_albumCacheService.invalidate(),
|
||||
_sharedAlbumCacheService.invalidate(),
|
||||
Hive.box<HiveSavedLoginInfo>(hiveLoginInfoBox).delete(savedLoginInfoKey)
|
||||
]);
|
||||
|
||||
state = state.copyWith(isAuthenticated: false);
|
||||
state = state.copyWith(isAuthenticated: false);
|
||||
|
||||
return true;
|
||||
return true;
|
||||
} catch (e) {
|
||||
debugPrint("Error logging out $e");
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
setAutoBackup(bool backupState) async {
|
||||
|
||||
Reference in New Issue
Block a user