TF-1915 Remove the needToOpen parameter in cases where it is not needed
(cherry picked from commit 1bd53ab9962494bbf48c86f4e61487f3316cbb62)
This commit is contained in:
@@ -12,8 +12,8 @@ class AuthenticationInfoCacheManager {
|
||||
authenticationInfoCache);
|
||||
}
|
||||
|
||||
Future<AuthenticationInfoCache?> getAuthenticationInfoStored({bool needToReopen = false}) {
|
||||
return _authenticationInfoCacheClient.getItem(AuthenticationInfoCache.keyCacheValue, needToReopen: needToReopen);
|
||||
Future<AuthenticationInfoCache?> getAuthenticationInfoStored() {
|
||||
return _authenticationInfoCacheClient.getItem(AuthenticationInfoCache.keyCacheValue);
|
||||
}
|
||||
|
||||
Future<void> removeAuthenticationInfo() {
|
||||
|
||||
@@ -36,8 +36,8 @@ class CredentialRepositoryImpl extends CredentialRepository {
|
||||
}
|
||||
|
||||
@override
|
||||
Future<AuthenticationInfoCache?> getAuthenticationInfoStored({bool needToReopen = false}) {
|
||||
return _authenticationInfoCacheManager.getAuthenticationInfoStored(needToReopen: needToReopen);
|
||||
Future<AuthenticationInfoCache?> getAuthenticationInfoStored() {
|
||||
return _authenticationInfoCacheManager.getAuthenticationInfoStored();
|
||||
}
|
||||
|
||||
@override
|
||||
|
||||
@@ -9,7 +9,7 @@ abstract class CredentialRepository {
|
||||
|
||||
Future<void> storeAuthenticationInfo(AuthenticationInfoCache authenticationInfoCache);
|
||||
|
||||
Future<AuthenticationInfoCache?> getAuthenticationInfoStored({bool needToReopen = false});
|
||||
Future<AuthenticationInfoCache?> getAuthenticationInfoStored();
|
||||
|
||||
Future<void> removeAuthenticationInfo();
|
||||
}
|
||||
@@ -20,7 +20,7 @@ class GetAuthenticatedAccountInteractor {
|
||||
this._getStoredTokenOidcInteractor
|
||||
);
|
||||
|
||||
Stream<Either<Failure, Success>> execute({bool needToReopen = false}) async* {
|
||||
Stream<Either<Failure, Success>> execute() async* {
|
||||
try {
|
||||
yield Right<Failure, Success>(LoadingState());
|
||||
final account = await _accountRepository.getCurrentAccount();
|
||||
@@ -29,7 +29,7 @@ class GetAuthenticatedAccountInteractor {
|
||||
if (account.authenticationType == AuthenticationType.oidc) {
|
||||
yield* _getStoredTokenOidcInteractor.execute(account.id);
|
||||
} else {
|
||||
yield await _getCredentialInteractor.execute(needToReopen: needToReopen);
|
||||
yield await _getCredentialInteractor.execute();
|
||||
}
|
||||
} catch (e) {
|
||||
logError('GetAuthenticatedAccountInteractor::execute(): $e');
|
||||
|
||||
@@ -15,10 +15,10 @@ class GetCredentialInteractor {
|
||||
|
||||
GetCredentialInteractor(this.credentialRepository);
|
||||
|
||||
Future<Either<Failure, Success>> execute({bool needToReopen = false}) async {
|
||||
Future<Either<Failure, Success>> execute() async {
|
||||
try {
|
||||
final baseUrl = await credentialRepository.getBaseUrl();
|
||||
final authenticationInfo = await credentialRepository.getAuthenticationInfoStored(needToReopen: needToReopen);
|
||||
final authenticationInfo = await credentialRepository.getAuthenticationInfoStored();
|
||||
if (isCredentialValid(baseUrl) && authenticationInfo != null) {
|
||||
return Right(GetCredentialViewState(
|
||||
baseUrl,
|
||||
|
||||
Reference in New Issue
Block a user