We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
The type of the response returned by the Authenticator doesn't match the CloudFrontRequestHandler response type from the aws-lambda package
Authenticator
CloudFrontRequestHandler
The types match
import { SSMClient, GetParameterCommand } from "@aws-sdk/client-ssm"; import { CloudFrontRequestHandler } from "aws-lambda"; import { Authenticator } from "cognito-at-edge"; const ssm = new SSMClient({ region: process.env.CONFIG_PARAMETER_REGION }); const authenticatorPromise = ssm .send(new GetParameterCommand({ Name: process.env.CONFIG_PARAMETER_NAME })) .then(config => new Authenticator({ ...JSON.parse(config.Parameter!.Value!), logLevel: 'info' })); export const handler: CloudFrontRequestHandler = async event => { try { const authenticator = await authenticatorPromise; return await authenticator.handle(event); } catch (error) { console.error(error); return { body: '401 Unauthorized', status: '401' }; } };
PR will be provided
The text was updated successfully, but these errors were encountered:
Successfully merging a pull request may close this issue.
What happened:
The type of the response returned by the
Authenticator
doesn't match theCloudFrontRequestHandler
response type from the aws-lambda packageWhat did you expect to have happen:
The types match
How to reproduce this (as precisely and succinctly as possible):
This should work
Anything else you think we should know?
PR will be provided
Environment:
The text was updated successfully, but these errors were encountered: