Remove LoginAPI, because it does not belongs to JMAP server
This commit is contained in:
committed by
Dat H. Pham
parent
5fd305d102
commit
afe6095c7e
@@ -1,20 +1,14 @@
|
||||
import 'package:model/model.dart';
|
||||
import 'package:tmail_ui_user/features/login/data/datasource/authentication_datasource.dart';
|
||||
import 'package:tmail_ui_user/features/login/data/network/login_api.dart';
|
||||
|
||||
class AuthenticationDataSourceImpl extends AuthenticationDataSource {
|
||||
|
||||
final LoginAPI loginAPI;
|
||||
|
||||
AuthenticationDataSourceImpl(this.loginAPI);
|
||||
AuthenticationDataSourceImpl();
|
||||
|
||||
@override
|
||||
Future<UserProfile> authenticationUser(Uri baseUrl, UserName userName, Password password) {
|
||||
return Future.sync(() async {
|
||||
final userProfileResponse = await loginAPI.authenticationUser(baseUrl, AccountRequest(userName, password));
|
||||
return userProfileResponse.toUserProfile();
|
||||
}).catchError((error) {
|
||||
throw error;
|
||||
return Future.sync(() {
|
||||
return UserProfile(userName.userName);
|
||||
});
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user