setupTwoFactorTotp method

  1. @override
Future<SetupTwoFactorTotp> setupTwoFactorTotp({
  1. required String token,
})
override

Arranca la configuración de 2FA por TOTP (Google Authenticator y similares): devuelve el secreto y el QR para escanear.

Implementation

@override
Future<SetupTwoFactorTotp> setupTwoFactorTotp({required String token}) async {
  final response = await dio.post(
    '/microsite/participants/verify_two_factor_totp/setup',
    options: Options(headers: {'Authorization': 'Bearer $token'}),
    data: {
      "api_key": Environment.apiKey,
      "campaign": Environment.campaign,
    },
  );
  final responseData = _parseResponse(response.data);
  return AuthMapper.setupTwoFactorTotpToEntity(
    SetupTwoFactorTotpResponse.fromJson(responseData),
  );
}