createMfaAuthenticator method

Future<MfaType> createMfaAuthenticator({
  1. required AuthenticatorType type,
})

Add an authenticator app to be used as an MFA factor. Verify the authenticator using the verify authenticator method.

Implementation

Future<models.MfaType> createMfaAuthenticator({
  required enums.AuthenticatorType type,
}) async {
  final String apiPath = '/account/mfa/authenticators/{type}'.replaceAll(
    '{type}',
    type.value,
  );

  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.MfaType.fromMap(res.data);
}