From 06153d302940dcc1f8e1edcd29565d638c8d5766 Mon Sep 17 00:00:00 2001 From: Juha Alhojoki Date: Thu, 11 Jan 2024 17:11:24 +0200 Subject: [PATCH] fixed an issue to enable claim to display, if it contains an array value --- 1-Authentication/1-sign-in-react/SPA/src/utils/claimUtils.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/1-Authentication/1-sign-in-react/SPA/src/utils/claimUtils.js b/1-Authentication/1-sign-in-react/SPA/src/utils/claimUtils.js index eab487aaf..a8444a65f 100644 --- a/1-Authentication/1-sign-in-react/SPA/src/utils/claimUtils.js +++ b/1-Authentication/1-sign-in-react/SPA/src/utils/claimUtils.js @@ -8,7 +8,7 @@ export const createClaimsTable = (claims) => { let index = 0; Object.keys(claims).forEach((key) => { - if (typeof claims[key] !== 'string' && typeof claims[key] !== 'number') return; + if (typeof claims[key] !== 'string' && typeof claims[key] !== 'number' && typeof claims[key] !== 'object') return; switch (key) { case 'aud': populateClaim( @@ -190,7 +190,7 @@ export const createClaimsTable = (claims) => { const populateClaim = (claim, value, description, index, claimsObject) => { let claimsArray = []; claimsArray[0] = claim; - claimsArray[1] = value; + claimsArray[1] = Array.isArray(value) ? value.join(", ") : value; claimsArray[2] = description; claimsObject[index] = claimsArray; };