Skip to content

Commit

Permalink
fix(jwt-parser): jwt claim array support (#799)
Browse files Browse the repository at this point in the history
fixes support of claim array values (was shown "[Object]" before)

Signed-off-by: Markus Blaschke <[email protected]>
  • Loading branch information
mblaschke authored Dec 12, 2023
1 parent 80e46c9 commit 5ed3693
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/tools/jwt-parser/jwt-parser.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ function decodeJwt({ jwt }: { jwt: string }) {

function parseClaims({ claim, value }: { claim: string; value: unknown }) {
const claimDescription = CLAIM_DESCRIPTIONS[claim];
const formattedValue = _.isPlainObject(value) ? JSON.stringify(value, null, 3) : _.toString(value);
const formattedValue = _.isPlainObject(value) || _.isArray(value) ? JSON.stringify(value, null, 3) : _.toString(value);
const friendlyValue = getFriendlyValue({ claim, value });

return {
Expand Down

1 comment on commit 5ed3693

@vercel
Copy link

@vercel vercel bot commented on 5ed3693 Dec 12, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.