forgotPassword method

Future<bool> forgotPassword(
  1. String email
)

Implementation

Future<bool> forgotPassword(String email) async {
  try {
    _dio.options.headers['content-Type'] = 'application/json';

    await _dio.post('$baseUrl/frontegg/identity/resources/users/v1/passwords/reset', data: {"email": email});
    return true;
  } catch (e) {
    if (e is DioError && e.response != null) {
      throw e.response!.data['errors'][0];
    }
    throw tr('invalid_authentication');
  }
}