Skip to content

Commit

Permalink
Merge branch 'master' into dependabot/npm_and_yarn/micromatch-4.0.8
Browse files Browse the repository at this point in the history
  • Loading branch information
tschoffelen authored Aug 30, 2024
2 parents f782981 + 5cddad6 commit 92899b4
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions src/policies/currentUser.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,12 @@ const currentUser = ({ event }) => {
const claimGroups = claims["cognito:groups"]
? claims["cognito:groups"]
: "[]";
const groups = Array.isArray(claimGroups) ? claimGroups : claimGroups
.substring(1, claimGroups.length - 1)
.split(" ")
.filter(Boolean);
const groups = Array.isArray(claimGroups)
? claimGroups
: claimGroups
.substring(1, claimGroups.length - 1)
.split(" ")
.filter(Boolean);

function hasGroup(group) {
return groups.includes(group);
Expand Down

0 comments on commit 92899b4

Please sign in to comment.