Login Repo

This commit is contained in:
efrilm
2025-09-18 07:04:06 +07:00
parent 1a0c0cf49b
commit b20854f329
9 changed files with 904 additions and 0 deletions
@@ -111,4 +111,28 @@ class AuthRepository implements IAuthRepository {
return left(const AuthFailure.unexpectedError());
}
}
@override
Future<Either<AuthFailure, Login>> login({
required String phoneNumber,
required String password,
}) async {
try {
final result = await _remoteDataProvider.login(
phoneNumber: phoneNumber,
password: password,
);
if (result.hasError) {
return left(result.error!);
}
final auth = result.data!.toDomain();
return right(auth);
} catch (e, s) {
log('loginError', name: _logName, error: e, stackTrace: s);
return left(const AuthFailure.unexpectedError());
}
}
}