fix(authentication): try/catch on cache retrieve
All checks were successful
continuous-integration/drone/pr Build is passing

This commit is contained in:
Hugo Pointcheval 2023-05-15 16:50:16 +02:00
parent 873a3b426d
commit ef19191093
Signed by: hugo
GPG Key ID: 3AAC487E131E00BC

View File

@ -41,13 +41,17 @@ class AuthenticationFirebaseCacheDataSourceImpl<Data>
return null; return null;
} }
final jwt = await currentUser.getIdToken(true); try {
final currentAccount = AccountModel.fromFirebaseUser( final jwt = await currentUser.getIdToken(true);
currentUser, final currentAccount = AccountModel.fromFirebaseUser(
accessToken: jwt, currentUser,
); accessToken: jwt,
);
return currentAccount; return currentAccount;
} catch (e) {
return null;
}
} }
// Already done by Firebase // Already done by Firebase