enableMfa method

Future<void> enableMfa(
  1. String totp
)

Enable MFA (Multi-Factor Authentication).

totp is the one-time password generated from an OTP secret, which is created via the generateMfa call.

Throws an ApiException if enabling MFA fails.

https://docs.nhost.io/auth/api-reference#enable-mfa

Implementation

Future<void> enableMfa(String totp) async {
  await _apiClient.post(
    '/mfa/enable',
    headers: _session.authenticationHeaders,
    data: {
      'code': totp,
    },
  );
}