updateMfaAuthenticator method

Future<User> updateMfaAuthenticator({
  1. required AuthenticatorType type,
  2. required String otp,
})

Verify Authenticator

Verify an authenticator app after adding it using the add authenticator method. add

Implementation

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

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

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

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

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