Skip to content

Commit

Permalink
Fix type mismatch of the status code
Browse files Browse the repository at this point in the history
  • Loading branch information
Piotrek Witkowski committed Apr 12, 2022
1 parent 3a91a59 commit 06915be
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import axios from 'axios';
import { parse, stringify } from 'querystring';
import pino from 'pino';
import { CognitoJwtVerifier } from 'aws-jwt-verify';
import { CloudFrontRequestEvent } from 'aws-lambda';
import { CloudFrontRequestEvent, CloudFrontRequestResult } from 'aws-lambda';

interface AuthenticatorParams {
region: string;
Expand Down Expand Up @@ -193,7 +193,7 @@ export class Authenticator {
* @param {Object} event Lambda@Edge event.
* @return {Promise} CloudFront response.
*/
async handle(event: CloudFrontRequestEvent) {
async handle(event: CloudFrontRequestEvent): Promise<CloudFrontRequestResult> {
this._logger.debug({ msg: 'Handling Lambda@Edge event', event });

const { request } = event.Records[0].cf;
Expand All @@ -220,7 +220,7 @@ export class Authenticator {
const userPoolUrl = `https://${this._userPoolDomain}/authorize?redirect_uri=${redirectURI}&response_type=code&client_id=${this._userPoolAppId}&state=${redirectPath}`;
this._logger.debug(`Redirecting user to Cognito User Pool URL ${userPoolUrl}`);
return {
status: 302,
status: '302',
headers: {
'location': [{
key: 'Location',
Expand Down

0 comments on commit 06915be

Please sign in to comment.