signInWithEmailAndPassword method
Implementation
@override
Future<Either<Failure, UserEntity>> signInWithEmailAndPassword(
String email,
String password,
) async {
try {
final user = await remoteDataSource.signInWithEmailAndPassword(email, password);
await localDataSource.cacheUser(user);
return Right(user);
} on AuthException catch (e) {
return Left(AuthFailure(e.message));
} on NetworkException catch (e) {
return Left(NetworkFailure(e.message));
} catch (e) {
return Left(AuthFailure('An unexpected error occurred'));
}
}