From a312dedf6504d758b2a048d62999f56cd014480e Mon Sep 17 00:00:00 2001 From: Corentin Thomasset Date: Tue, 21 Feb 2023 22:52:08 +0100 Subject: [PATCH] fix(jwt-parser): prevent [object Object] value --- src/tools/jwt-parser/jwt-parser.service.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/tools/jwt-parser/jwt-parser.service.ts b/src/tools/jwt-parser/jwt-parser.service.ts index 9bc994cc..f5eb04ec 100644 --- a/src/tools/jwt-parser/jwt-parser.service.ts +++ b/src/tools/jwt-parser/jwt-parser.service.ts @@ -20,7 +20,7 @@ function decodeJwt({ jwt }: { jwt: string }) { function parseClaims({ claim, value }: { claim: string; value: unknown }) { const claimDescription = CLAIM_DESCRIPTIONS[claim]; - const formattedValue = _.toString(value); + const formattedValue = _.isPlainObject(value) ? JSON.stringify(value, null, 3) : _.toString(value); const friendlyValue = getFriendlyValue({ claim, value }); return {