fix: Unable to log-out user with incorrect/old token (#104)

Co-authored-by: PartyDonut <PartyDonut@users.noreply.github.com>
This commit is contained in:
PartyDonut 2024-11-02 09:56:01 +01:00 committed by GitHub
parent 0761a50bfa
commit d3e34d57e0
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 11 additions and 14 deletions

View file

@ -64,8 +64,12 @@ class SharedUtility {
Future<bool?> removeAccount(AccountModel? account) async {
if (account == null) return null;
//Try to logout user
await ref.read(userProvider.notifier).forceLogoutUser(account);
try {
//Try to logout user
await ref.read(userProvider.notifier).forceLogoutUser(account);
} catch (e) {
log('Unable to log-out user forcing anyway $e');
}
//Remove from local database
final savedAccounts = getAccounts();