Skip to content

Commit

Permalink
chore: lint
Browse files Browse the repository at this point in the history
  • Loading branch information
tschoffelen committed Aug 30, 2024
1 parent d4b3fe9 commit 5cddad6
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 5cddad6

Please sign in to comment.