forgotPassword method

  1. @override
Future<AuthResult<void>> forgotPassword(
  1. String email
)
override

Implementation

@override
Future<AuthResult<void>> forgotPassword(String email) async {
  try {
    final response = await _client.post(
      Uri.parse('$baseUrl/auth/forgot-password'),
      headers: _headers,
      body: jsonEncode({'email': email}),
    );
    return _handleResponse(response);
  } catch (e) {
    return AuthResult.failure(AuthException(e.toString(), code: 'network-error'));
  }
}