Skip to content
This repository was archived by the owner on May 3, 2024. It is now read-only.

Commit 1086064

Browse files
committed
fixed issue with home page table
1 parent 3d38e45 commit 1086064

File tree

5 files changed

+33
-20
lines changed

5 files changed

+33
-20
lines changed

2-Authorization-I/1-call-graph/SPA/src/utils/claimUtils.js

+1
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ export const createClaimsTable = (claims) => {
88
let index = 0;
99

1010
Object.keys(claims).map((key) => {
11+
if (typeof claims[key] !== 'string' && typeof claims[key] !== 'number') return;
1112
switch (key) {
1213
case 'aud':
1314
populateClaim(

2-Authorization-I/2-call-arm/SPA/src/utils/claimUtils.js

+1
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ export const createClaimsTable = (claims) => {
88
let index = 0;
99

1010
Object.keys(claims).forEach((key) => {
11+
if (typeof claims[key] !== 'string' && typeof claims[key] !== 'number') return;
1112
switch (key) {
1213
case 'aud':
1314
populateClaim(

3-Authorization-II/1-call-api/SPA/src/utils/claimUtils.js

+29-20
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ export const createClaimsTable = (claims) => {
88
let index = 0;
99

1010
Object.keys(claims).map((key) => {
11+
if (typeof claims[key] !== 'string' && typeof claims[key] !== 'number') return;
1112
switch (key) {
1213
case 'aud':
1314
populateClaim(
@@ -144,25 +145,33 @@ export const createClaimsTable = (claims) => {
144145
index++;
145146
break;
146147
case 'sub':
147-
populateClaim(key, claims[key], 'The sub claim is a pairwise identifier - it is unique to a particular application ID. If a single user signs into two different apps using two different client IDs, those apps will receive two different values for the subject claim.', index, claimsObj);
148+
populateClaim(
149+
key,
150+
claims[key],
151+
'The sub claim is a pairwise identifier - it is unique to a particular application ID. If a single user signs into two different apps using two different client IDs, those apps will receive two different values for the subject claim.',
152+
index,
153+
claimsObj
154+
);
148155
index++;
149156
break;
150157
case 'ver':
151-
populateClaim(key, claims[key], 'Version of the token issued by the Microsoft identity platform', index, claimsObj);
158+
populateClaim(
159+
key,
160+
claims[key],
161+
'Version of the token issued by the Microsoft identity platform',
162+
index,
163+
claimsObj
164+
);
152165
index++;
153166
break;
154167
case 'uti':
155168
case 'rh':
156169
index++;
157170
break;
171+
case '_claim_names':
172+
case '_claim_sources':
158173
default:
159-
populateClaim(
160-
key,
161-
claims[key],
162-
'',
163-
index,
164-
claimsObj
165-
);
174+
populateClaim(key, claims[key], '', index, claimsObj);
166175
index++;
167176
}
168177
});
@@ -171,13 +180,13 @@ export const createClaimsTable = (claims) => {
171180
};
172181

173182
/**
174-
* Populates claim, description, and value into an claimsObject
175-
* @param {String} claim
176-
* @param {String} value
177-
* @param {String} description
178-
* @param {Number} index
179-
* @param {Object} claimsObject
180-
*/
183+
* Populates claim, description, and value into an claimsObject
184+
* @param {String} claim
185+
* @param {String} value
186+
* @param {String} description
187+
* @param {Number} index
188+
* @param {Object} claimsObject
189+
*/
181190
const populateClaim = (claim, value, description, index, claimsObject) => {
182191
let claimsArray = [];
183192
claimsArray[0] = claim;
@@ -187,10 +196,10 @@ const populateClaim = (claim, value, description, index, claimsObject) => {
187196
};
188197

189198
/**
190-
* Transforms Unix timestamp to date and returns a string value of that date
191-
* @param {String} date Unix timestamp
192-
* @returns
193-
*/
199+
* Transforms Unix timestamp to date and returns a string value of that date
200+
* @param {String} date Unix timestamp
201+
* @returns
202+
*/
194203
const changeDateFormat = (date) => {
195204
let dateObj = new Date(date * 1000);
196205
return `${date} - [${dateObj.toString()}]`;

5-AccessControl/1-call-api-roles/SPA/src/utils/claimUtils.js

+1
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ export const createClaimsTable = (claims) => {
88
let index = 0;
99

1010
Object.keys(claims).map((key) => {
11+
if (typeof claims[key] !== 'string' && typeof claims[key] !== 'number') return;
1112
switch (key) {
1213
case 'aud':
1314
populateClaim(

5-AccessControl/2-call-api-groups/SPA/src/utils/claimUtils.js

+1
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ export const createClaimsTable = (claims) => {
88
let index = 0;
99

1010
Object.keys(claims).forEach((key) => {
11+
if (typeof claims[key] !== 'string' && typeof claims[key] !== 'number') return;
1112
switch (key) {
1213
case 'aud':
1314
populateClaim(

0 commit comments

Comments
 (0)