login method

Future<AuthResponse> login(
  1. String email,
  2. String password
)

Autentica al usuario contra POST /auth/login.

Lanza una excepción si las credenciales son incorrectas o el servidor no responde.

Implementation

Future<AuthResponse> login(String email, String password) async {
  try {
    final response = await _apiClient.post(
      "/auth/login",
      data: {"email": email, "password": password},
    );

    return AuthResponse.fromJson(response.data);
  } catch (e) {
    rethrow;
  }
}