Skip to content

Commit

Permalink
Make subject_syntax_types_supported from client metadata optional
Browse files Browse the repository at this point in the history
  • Loading branch information
hawkbee1 committed May 28, 2024
1 parent c3e1f0a commit 3cef1b4
Showing 1 changed file with 13 additions and 10 deletions.
23 changes: 13 additions & 10 deletions lib/dashboard/qr_code/qr_code_scan/cubit/qr_code_scan_cubit.dart
Original file line number Diff line number Diff line change
Expand Up @@ -632,16 +632,19 @@ class QRCodeScanCubit extends Cubit<QRCodeScanState> {
if (clientMetadata != null) {
final clientMetadataMap =
jsonDecode(clientMetadata) as Map<String, dynamic>;
final data =
clientMetadataMap['subject_syntax_types_supported'] as List<dynamic>;
if (!data.contains('did:key')) {
if (isSecurityHigh) {
throw ResponseMessage(
data: {
'error': 'unsupported_response_type',
'error_description': 'The subject syntax type is not supported.',
},
);
if (clientMetadataMap['subject_syntax_types_supported'] != null) {
final data = clientMetadataMap['subject_syntax_types_supported']
as List<dynamic>;
if (!data.contains('did:key')) {
if (isSecurityHigh) {
throw ResponseMessage(
data: {
'error': 'unsupported_response_type',
'error_description':
'The subject syntax type is not supported.',
},
);
}
}
}
}
Expand Down

0 comments on commit 3cef1b4

Please sign in to comment.