challenge method

Future<Map<String, dynamic>> challenge({
  1. required String challengeId,
  2. required String method,
})

Triggers a challenge delivery via method for challengeId.

Implementation

Future<Map<String, dynamic>> challenge({
  required String challengeId,
  required String method,
}) async {
  final uri = auth.baseUrl.resolve('/auth/mfa/challenge');
  final response = await auth.dio.post<dynamic>(
    uri.toString(),
    data: {'challenge_id': challengeId, 'method': method},
    options: Options(headers: {'Accept': 'application/json'}),
  );
  return response.data is Map<String, dynamic>
      ? response.data as Map<String, dynamic>
      : {};
}