TF-2667 Use Username replace UserProfile

This commit is contained in:
dab246
2024-03-05 10:02:08 +07:00
committed by Dat H. Pham
parent de4849f551
commit c9fed1fa41
36 changed files with 148 additions and 245 deletions
@@ -29,24 +29,24 @@ class AuthenticationInteractor {
}) async* {
try {
yield Right(AuthenticationUserLoading());
final user = await authenticationRepository.authenticationUser(baseUrl, userName, password);
final username = await authenticationRepository.authenticationUser(baseUrl, userName, password);
await Future.wait([
credentialRepository.saveBaseUrl(baseUrl),
credentialRepository.storeAuthenticationInfo(
AuthenticationInfoCache(
userName.value,
username.value,
password.value
)
),
]);
await _accountRepository.setCurrentAccount(
PersonalAccount(
userName.value,
username.value,
AuthenticationType.basic,
isSelected: true
)
);
yield Right(AuthenticationUserSuccess(user));
yield Right(AuthenticationUserSuccess(username));
} catch (e) {
yield Left(AuthenticationUserFailure(e));
}