resetPwdWithCode method

Future<APIError?> resetPwdWithCode(
  1. String phone,
  2. String code,
  3. String newPassword
)

Resets the password of the user using the SMS code provided through the sendResetPwdCode method.

phone The phone number of the user code The SMS code that is sent to the users phone number newPassword The new password of the user

Implementation

Future<APIError?> resetPwdWithCode(
        String phone, String code, String newPassword) async =>
    (await _fetcher.post<dynamic>(
            '/_api/rest/v1/auth/reset-pwd-code${encodeUriParameters({
                  'phone': phone,
                  'code': code
                })}',
            body: {'newPassword': newPassword}))
        .errors;