generateMfa method

  1. @override
Future<MultiFactorAuthResponse> generateMfa()

Generates an MFA (Multi-Factor Authentication) QR-code.

The user must be logged in to generate this QR-code. The user should scan the QR-code with their password manager.

The password manager will return a code (one-time password) that will be used to enableMfa and disableMfa.

Throws an NhostException if MFA generation fails.

Implementation

@override
Future<MultiFactorAuthResponse> generateMfa() async {
  return await _apiClient.get(
    '/mfa/totp/generate',
    headers: _session.authenticationHeaders,
    responseDeserializer: MultiFactorAuthResponse.fromJson,
  );
}