aboutsummaryrefslogtreecommitdiff
path: root/src/tools/jwt-parser/jwt-parser.service.ts
diff options
context:
space:
mode:
authorGravatar Corentin Thomasset <corentin.thomasset74@gmail.com> 2023-02-21 22:52:08 +0100
committerGravatar Corentin Thomasset <corentin.thomasset74@gmail.com> 2023-02-21 22:52:08 +0100
commita312dedf6504d758b2a048d62999f56cd014480e (patch)
treef09114a95b793e812435539ee98226354e2426bc /src/tools/jwt-parser/jwt-parser.service.ts
parent0ddf18f4b5347230759b9be800ef1541e150d9cf (diff)
downloadit-tools-a312dedf6504d758b2a048d62999f56cd014480e.tar.gz
it-tools-a312dedf6504d758b2a048d62999f56cd014480e.tar.zst
it-tools-a312dedf6504d758b2a048d62999f56cd014480e.zip
fix(jwt-parser): prevent [object Object] value
Diffstat (limited to 'src/tools/jwt-parser/jwt-parser.service.ts')
-rw-r--r--src/tools/jwt-parser/jwt-parser.service.ts2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/tools/jwt-parser/jwt-parser.service.ts b/src/tools/jwt-parser/jwt-parser.service.ts
index 9bc994c..f5eb04e 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 {