Skip to content

Commit

Permalink
feat: Remove jwt from json display in dev mode #2894
Browse files Browse the repository at this point in the history
  • Loading branch information
bibash28 committed Sep 20, 2024
1 parent 2709b74 commit 387729f
Showing 1 changed file with 5 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,9 @@ class DeveloperDetails extends StatelessWidget {
jwtDecode: jwtDecode,
token: credentialModel.jwt!,
);
payload = const JsonEncoder.withIndent(' ').convert(jsonPayload);
payload = const JsonEncoder.withIndent(' ').convert(
Map.of(jsonPayload)..removeWhere((key, value) => key == 'jwt'),
);

if (credentialModel.getFormat == VCFormatType.vcSdJWT.vcValue) {
final selectiveDisclosure = SelectiveDisclosure(credentialModel);
Expand All @@ -63,7 +65,8 @@ class DeveloperDetails extends StatelessWidget {
selectiveDisclosure: selectiveDisclosure,
);

payload = const JsonEncoder.withIndent(' ').convert(data);
payload = const JsonEncoder.withIndent(' ')
.convert(Map.of(data)..removeWhere((key, value) => key == 'jwt'));

final probableJwt = credentialModel.jwt?.split('~').last;
kbHeader = 'None';
Expand Down

0 comments on commit 387729f

Please sign in to comment.