Skip to content

Commit

Permalink
Switch to array contains.
Browse files Browse the repository at this point in the history
  • Loading branch information
marklise committed Oct 8, 2024
1 parent a771052 commit 678c132
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion handlers/authorizer/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ exports.handler = async function (event, context, callback) {
console.log("userData:", userData);

// Generate the methodArn for the user to access the API
if (userData.claims === 'sysadmin') {
if (userData.claims?.includes('sysadmin')) {
const arnPrefix = event.methodArn.split(':').slice(0, 6);
const joinedArnPrefix = arnPrefix.slice(0, 5).join(':');
const apiIDString = arnPrefix[5];
Expand Down

0 comments on commit 678c132

Please sign in to comment.