createMfaRecoveryCodes method

Future<MfaRecoveryCodes> createMfaRecoveryCodes()

Create MFA Recovery Codes

Generate recovery codes as backup for MFA flow. It's recommended to generate and show then immediately after user successfully adds their authehticator. Recovery codes can be used as a MFA verification type in createMfaChallenge method.

Implementation

Future<models.MfaRecoveryCodes> createMfaRecoveryCodes() async {
  const String apiPath = '/account/mfa/recovery-codes';

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

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

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

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