fix(jwt-parser): prevent [object Object] value

This commit is contained in:
Corentin Thomasset 2023-02-21 22:52:08 +01:00
parent 0ddf18f4b5
commit a312dedf65
No known key found for this signature in database
GPG Key ID: DBD997E935996158

View File

@ -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 {