Skip to content

Commit

Permalink
fix: logging for aws lambda
Browse files Browse the repository at this point in the history
  • Loading branch information
sattvikc committed Aug 23, 2024
1 parent 14144d8 commit 4483924
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
3 changes: 2 additions & 1 deletion lib/build/framework/awsLambda/framework.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ const utils_2 = require("../utils");
const constants_1 = require("../constants");
const supertokens_1 = __importDefault(require("../../supertokens"));
const querystring_1 = require("querystring");
const logger_1 = require("../../logger");
class AWSRequest extends request_1.BaseRequest {
constructor(event) {
super();
Expand Down Expand Up @@ -78,7 +79,7 @@ class AWSRequest extends request_1.BaseRequest {
let path = this.event.path;
let queryParams = this.event.queryStringParameters;
if (path === undefined) {
console.log(this.event);
logger_1.logDebugMessage(JSON.stringify(this.event));
path = this.event.requestContext.http.path;
let stage = this.event.requestContext.stage;
if (stage !== undefined && path.startsWith(`/${stage}`)) {
Expand Down
3 changes: 2 additions & 1 deletion lib/ts/framework/awsLambda/framework.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ import { SessionContainerInterface } from "../../recipe/session/types";
import SuperTokens from "../../supertokens";
import { Framework } from "../types";
import { parse } from "querystring";
import { logDebugMessage } from "../../logger";

export class AWSRequest extends BaseRequest {
private event: APIGatewayProxyEventV2 | APIGatewayProxyEvent;
Expand Down Expand Up @@ -109,7 +110,7 @@ export class AWSRequest extends BaseRequest {
let path = (this.event as APIGatewayProxyEvent).path;
let queryParams = (this.event as APIGatewayProxyEvent).queryStringParameters as { [key: string]: string };
if (path === undefined) {
console.log(this.event);
logDebugMessage(JSON.stringify(this.event));
path = (this.event as APIGatewayProxyEventV2).requestContext.http.path;
let stage = (this.event as APIGatewayProxyEventV2).requestContext.stage;
if (stage !== undefined && path.startsWith(`/${stage}`)) {
Expand Down

0 comments on commit 4483924

Please sign in to comment.