You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Feb 2, 2025. It is now read-only.
I tried to execute the code as an AWS Lambda Function, but I get an error response about the 'async function fetchKeys()'. What am I missing?
//required params
const params = {
region: '<your-aws-region>',
userPoolId: '<your-user-pool-id>'
}
//optional claims examples
const claims = {
aud: '<your-app-client-id>',
email_verified: true,
auth_time: time => time <= 1524588564,
'cognito:groups': groups => groups.includes('Admins')
}
const Verifier = require('verify-cognito-token');
const verifier = new Verifier(params, claims);
verifier.verify(token)
.then(result =>{
//result will be `true` if token is valid, non-expired, and has matching claims
//result will be `false` if token is invalid, expired or fails the claims check
})
Response:
{
"errorMessage": "RequestId: 4f8d8756-c097-11e8-8adf-6f88f5e6d44a Process exited before completing request"
}
Function Logs:
START RequestId: 4f8d8756-c097-11e8-8adf-6f88f5e6d44a Version: $LATEST
2018-09-25T07:47:54.317Z 4f8d8756-c097-11e8-8adf-6f88f5e6d44a /var/task/node_modules/verify-cognito-token/index.js:6
async function fetchKeys() {
^^^^^^^^
SyntaxError: Unexpected token function
at createScript (vm.js:56:10)
at Object.runInThisContext (vm.js:97:10)
at Module._compile (module.js:542:28)
at Object.Module._extensions..js (module.js:579:10)
at Module.load (module.js:487:32)
at tryModuleLoad (module.js:446:12)
at Function.Module._load (module.js:438:3)
at Module.require (module.js:497:17)
at require (internal/module.js:20:19)
at exports.handler (/var/task/index.js:17:22)
END RequestId: 4f8d8756-c097-11e8-8adf-6f88f5e6d44a
REPORT RequestId: 4f8d8756-c097-11e8-8adf-6f88f5e6d44a Duration: 191.85 ms Billed Duration: 200 ms Memory Size: 128 MB Max Memory Used: 19 MB
RequestId: 4f8d8756-c097-11e8-8adf-6f88f5e6d44a Process exited before completing request
The text was updated successfully, but these errors were encountered:
Hi,
I tried to execute the code as an AWS Lambda Function, but I get an error response about the 'async function fetchKeys()'. What am I missing?
The text was updated successfully, but these errors were encountered: