resetEmailPassword static method

Future<Map<String, dynamic>> resetEmailPassword({
  1. required String email,
})

Returns a map with the following keys: if there was no error:

  • token: Token from Appwrite if there was an error:
  • error: true if there was an error
  • type: error if there was an error
  • message: String containing the error message
  • code: int containing the error code

Implementation

static Future<Map<String, dynamic>> resetEmailPassword({
  /// Email of the user to reset password
  required String email,
}) async {
  Account account = Account(_client);

  try {
    final models.Token token = await account.createRecovery(
      email: email,
      url: _recovery ?? _client.endPoint,
    );

    _token = token;

    return token.toMap();
  } on AppwriteException catch (e) {
    return {
      'error': true,
      'type': e.type,
      'message': e.message,
      'code': e.code,
    };
  }
}