updateMfaRecoveryCodes method

Future<MfaRecoveryCodes> updateMfaRecoveryCodes({
  1. required String userId,
})

Regenerate MFA Recovery Codes

Regenerate recovery codes that can be used as backup for MFA flow by User ID. Before regenerating codes, they must be first generated using createMfaRecoveryCodes method.

Implementation

Future<models.MfaRecoveryCodes> updateMfaRecoveryCodes(
    {required String userId}) async {
  final String apiPath =
      '/users/{userId}/mfa/recovery-codes'.replaceAll('{userId}', userId);

  final Map<String, dynamic> apiParams = {};

  final Map<String, String> apiHeaders = {
    'content-type': 'application/json',
  };

  final res = await client.call(HttpMethod.put,
      path: apiPath, params: apiParams, headers: apiHeaders);

  return models.MfaRecoveryCodes.fromMap(res.data);
}