Skip to content

Commit

Permalink
feat: Remove unncecesary developer data in authorization code flow #2462
Browse files Browse the repository at this point in the history
  • Loading branch information
bibash28 committed Mar 5, 2024
1 parent b705e90 commit 212df93
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 60 deletions.
14 changes: 0 additions & 14 deletions lib/app/shared/helper_functions/helper_functions.dart
Original file line number Diff line number Diff line change
Expand Up @@ -1161,20 +1161,6 @@ ${openIdConfiguration != null ? const JsonEncoder.withIndent(' ').convert(openI
''';
}

String getFormattedStringOIDC4VCIAuthorizedCodeFlow({
required String url,
Map<String, dynamic>? statePayload,
dynamic codeForAuthorisedFlow,
}) {
return '''
<b>SCHEME :</b> ${getSchemeFromUrl(url)}\n
<b>STATE :</b>
${statePayload != null ? const JsonEncoder.withIndent(' ').convert(statePayload) : 'None'}\n
<b>CODE :</b>
$codeForAuthorisedFlow
''';
}

String getFormattedStringResponse({
required Map<String, dynamic>? tokenData,
required List<dynamic>? credentialData,
Expand Down
46 changes: 0 additions & 46 deletions lib/splash/bloclisteners/blocklisteners.dart
Original file line number Diff line number Diff line change
Expand Up @@ -490,52 +490,6 @@ final qrCodeBlocListener = BlocListener<QRCodeScanCubit, QRCodeScanState>(

final statePayload = jwt.payload as Map<String, dynamic>;

/// if dev mode is ON show some dialog to show data
if (profileCubit.state.model.isDeveloperMode) {
final String formattedData =
getFormattedStringOIDC4VCIAuthorizedCodeFlow(
url: state.uri.toString(),
codeForAuthorisedFlow: codeForAuthorisedFlow,
statePayload: statePayload,
);

LoadingView().hide();
final bool moveAhead = await showDialog<bool>(
context: context,
builder: (_) {
return DeveloperModeDialog(
onDisplay: () async {
Navigator.of(context).pop(false);
await Navigator.of(context).push<void>(
JsonViewerPage.route(
title: l10n.display,
data: formattedData,
),
);
return;
},
onDownload: () {
Navigator.of(context).pop(false);

final box = context.findRenderObject() as RenderBox?;
final subject = l10n.shareWith;

Share.share(
formattedData,
subject: subject,
sharePositionOrigin:
box!.localToGlobal(Offset.zero) & box.size,
);
},
onSkip: () {
Navigator.of(context).pop(true);
},
);
},
) ??
true;
if (!moveAhead) return;
}
await context.read<QRCodeScanCubit>().authorizedFlowCompletion(
statePayload: statePayload,
codeForAuthorisedFlow: codeForAuthorisedFlow,
Expand Down

0 comments on commit 212df93

Please sign in to comment.