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

Commit dda86c0

Browse files
committed
updated routegaurd
1 parent 2eac2a8 commit dda86c0

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

5-AccessControl/2-call-api-groups/SPA/src/components/RouteGuard.jsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ export const RouteGuard = ({ Component, ...props }) => {
3333
}
3434
} else if (
3535
currentAccount &&
36-
(currentAccount.idTokenClaims['_claim_names'] ||
36+
(currentAccount.idTokenClaims['_claim_names'] &&
3737
(currentAccount.idTokenClaims['_claim_sources'] && !isOveraged))
3838
) {
3939
setIsOveraged(true);
@@ -55,8 +55,8 @@ export const RouteGuard = ({ Component, ...props }) => {
5555

5656
if (
5757
currentAccount &&
58-
(currentAccount.idTokenClaims['_claim_names'] ||
59-
(currentAccount.idTokenClaims['_claim_sources'] && !isOveraged))
58+
(currentAccount.idTokenClaims['_claim_names'] &&
59+
(currentAccount.idTokenClaims['_claim_sources'] && isOveraged))
6060
) {
6161
window.alert(
6262
'You have too many group memberships. The application will now query Microsoft Graph to get the full list of groups that you are a member of.'

0 commit comments

Comments
 (0)