TF-607 Delete authority oidc when logout
This commit is contained in:
@@ -14,6 +14,8 @@ abstract class AuthenticationOIDCRepository {
|
||||
|
||||
Future<void> persistAuthorityOidc(String authority);
|
||||
|
||||
Future<void> deleteAuthorityOidc();
|
||||
|
||||
Future<OIDCConfiguration> getStoredOidcConfiguration();
|
||||
|
||||
Future<TokenOIDC> refreshingTokensOIDC(
|
||||
|
||||
@@ -0,0 +1,17 @@
|
||||
import 'package:core/core.dart';
|
||||
|
||||
class DeleteAuthorityOidcSuccess extends UIState {
|
||||
DeleteAuthorityOidcSuccess();
|
||||
|
||||
@override
|
||||
List<Object> get props => [];
|
||||
}
|
||||
|
||||
class DeleteAuthorityOidcFailure extends FeatureFailure {
|
||||
final dynamic exception;
|
||||
|
||||
DeleteAuthorityOidcFailure(this.exception);
|
||||
|
||||
@override
|
||||
List<Object> get props => [exception];
|
||||
}
|
||||
@@ -0,0 +1,22 @@
|
||||
import 'dart:core';
|
||||
|
||||
import 'package:core/presentation/state/failure.dart';
|
||||
import 'package:core/presentation/state/success.dart';
|
||||
import 'package:dartz/dartz.dart';
|
||||
import 'package:tmail_ui_user/features/login/domain/repository/authentication_oidc_repository.dart';
|
||||
import 'package:tmail_ui_user/features/login/domain/state/delete_authority_oidc_state.dart';
|
||||
|
||||
class DeleteAuthorityOidcInteractor {
|
||||
final AuthenticationOIDCRepository _authenticationOIDCRepository;
|
||||
|
||||
DeleteAuthorityOidcInteractor(this._authenticationOIDCRepository);
|
||||
|
||||
Future<Either<Failure, Success>> execute() async {
|
||||
try {
|
||||
await _authenticationOIDCRepository.deleteAuthorityOidc();
|
||||
return Right(DeleteAuthorityOidcSuccess());
|
||||
} catch (exception) {
|
||||
return Left(DeleteAuthorityOidcFailure(exception));
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user