TF-607 Delete authority oidc when logout

This commit is contained in:
dab246
2022-06-03 18:37:17 +07:00
committed by Dat H. Pham
parent ced3fecd1f
commit c445d3c71a
14 changed files with 105 additions and 18 deletions
@@ -18,7 +18,7 @@ class LogoutOidcInteractor {
LogoutOidcInteractor(this._accountRepository, this._authenticationOIDCRepository);
Future<Either<Failure, Success>> execute() async {
Stream<Either<Failure, Success>> execute() async* {
try {
final currentAccount = await _accountRepository.getCurrentAccount();
@@ -33,16 +33,16 @@ class LogoutOidcInteractor {
});
log('LogoutOidcInteractor::execute(): statusSuccess: $result');
if (result) {
return Right<Failure, Success>(LogoutOidcSuccess());
yield Right<Failure, Success>(LogoutOidcSuccess());
} else {
return Left<Failure, Success>(LogoutOidcFailure(null));
yield Left<Failure, Success>(LogoutOidcFailure(null));
}
} else {
return Left<Failure, Success>(LogoutOidcFailure(NotFoundAuthenticatedAccountException()));
yield Left<Failure, Success>(LogoutOidcFailure(NotFoundAuthenticatedAccountException()));
}
} catch (e) {
log('LogoutOidcInteractor::execute(): EXCEPTION: $e');
return Left<Failure, Success>(LogoutOidcFailure(e));
yield Left<Failure, Success>(LogoutOidcFailure(e));
}
}
}