aboutsummaryrefslogtreecommitdiff
path: root/src/tools/jwt-parser/jwt-parser.service.ts
diff options
context:
space:
mode:
authorGravatar Markus Blaschke <mblaschke82@gmail.com> 2023-12-12 14:04:19 +0100
committerGravatar GitHub <noreply@github.com> 2023-12-12 14:04:19 +0100
commit5ed36935c7fb56d8c0ce89cdd06c6a0afb60fd28 (patch)
tree33f517a38d2883b3fdf6de4a00ec7fab816735a4 /src/tools/jwt-parser/jwt-parser.service.ts
parent80e46c92922c1a886be08f4747b6c9f791a625e8 (diff)
downloadit-tools-5ed36935c7fb56d8c0ce89cdd06c6a0afb60fd28.tar.gz
it-tools-5ed36935c7fb56d8c0ce89cdd06c6a0afb60fd28.tar.zst
it-tools-5ed36935c7fb56d8c0ce89cdd06c6a0afb60fd28.zip
fix(jwt-parser): jwt claim array support (#799)
fixes support of claim array values (was shown "[Object]" before) Signed-off-by: Markus Blaschke <mblaschke82@gmail.com>
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 cc39145..543f4c8 100644
--- a/src/tools/jwt-parser/jwt-parser.service.ts
+++ b/src/tools/jwt-parser/jwt-parser.service.ts
@@ -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 {