requestEmailChange method

Future<void> requestEmailChange(
  1. String email,
  2. String password, {
  3. String? externalToken,
  4. String? authID,
  5. required void onSuccess(),
  6. required void onError(
    1. SyneriseError error
    ),
})

The function requestEmailChange sends a request to change the user's email address.

Args: email (String): The email parameter is a string that represents the new email address that the user wants to change to. password (String): The password parameter is a string that represents the user's current password. externalToken (String): The externalToken parameter is an optional string that represents an external token used for authentication. authID (String): The authID parameter is an optional parameter that represents the authentication ID of the user.

Implementation

Future<void> requestEmailChange(String email, String password,
    {String? externalToken,
    String? authID,
    required void Function() onSuccess,
    required void Function(SyneriseError error) onError}) async {
  SyneriseResult<void> result = await _methods.requestEmailChange(
      email, password, externalToken, authID);

  result.onSuccess((result) {
    onSuccess();
  }).onError((error) {
    onError(error);
  });
}