MCPcopy Create free account
hub / github.com/aws-samples/serverless-coffee / isAdmin

Function isAdmin

backends/9-validator/code/getCode.js:11–18  ·  view source on GitHub ↗
(requestContext)

Source from the content-addressed store, hash-verified

9const NANO_ID_CODE_LENGTH = process.env.CodeLength
10
11const isAdmin = (requestContext) => {
12 try {
13 const groups = requestContext.authorizer.claims['cognito:groups'].replace('[','').replace(']','').split(',')
14 return groups.includes('admin')
15 } catch (err) {
16 return false
17 }
18}
19
20// Returns details of a Place ID where the app has user-generated content.
21exports.handler = async (event) => {

Callers 1

getCode.jsFile · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected