Skip to content

Commit

Permalink
fix: response status code check (#219)
Browse files Browse the repository at this point in the history
  • Loading branch information
ethan-tbd authored Jul 9, 2024
1 parent 37aa43d commit c74a978
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions lib/features/kcc/kcc_issuance_service.dart
Original file line number Diff line number Diff line change
Expand Up @@ -113,13 +113,13 @@ class KccIssuanceService {
body: jsonEncode(authResponse.toJson()),
);

if (response.statusCode != 200) {
throw Exception(
'Sending siopv2 AuthResponse failed: ${response.statusCode} ${response.body}',
);
if (response.statusCode >= 200 && response.statusCode < 300) {
return IdvRequest.fromJson(response.body);
}

return IdvRequest.fromJson(response.body);
throw Exception(
'Sending siopv2 AuthResponse failed: ${response.statusCode} ${response.body}',
);
}

/// Requests an access token from the PFI (aka KCC issuer) using the
Expand Down

0 comments on commit c74a978

Please sign in to comment.