sendResetPwdCode method

Future<APIError?> sendResetPwdCode(
  1. String phone
)

Sends an SMS code to reset password.

This method works only if phone number confirmation is enabled in your app authentication settings and the user's phone number has already been verified.

After sending the SMS code, you need to display a password reset form to the user. When you get the new password from the user, you can call resetPwdWithCode method with the phone number of the user, SMS code and new password.

If phone number confirmation is disabled in your app authentication settings or if the user's phone has not been verified, it returns an error

phone The phone number of the user to send the reset password code.

Implementation

Future<APIError?> sendResetPwdCode(String phone) async =>
    (await _fetcher.post<dynamic>(
            '/_api/rest/v1/auth/send-reset${encodeUriParameters({
          "phone": phone
        })}'))
        .errors;