disableTwoFactor method

Future<StatusResponse> disableTwoFactor({
  1. required String password,
})

Disable two factor This will disable the two factor authentication and delete the backup codes.

password The password of the user

Implementation

Future<StatusResponse> disableTwoFactor({required String password}) async {
  try {
    final response = await dio.post(
      "/two-factor/disable",
      data: {"password": password},
      options: await super.getOptions(),
    );
    return StatusResponse.fromJson(response.data);
  } catch (e) {
    final message = getErrorMessage(e);
    if (message == null) rethrow;
    throw message;
  }
}