Skip to content

Commit

Permalink
fix(remove-cookie-parser): remove cookie parser and log not allowed o…
Browse files Browse the repository at this point in the history
…rigins
  • Loading branch information
Cali93 committed Jul 13, 2023
1 parent b55c4e7 commit b60b02f
Show file tree
Hide file tree
Showing 3 changed files with 1 addition and 61 deletions.
56 changes: 0 additions & 56 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 0 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@
"@prisma/client": "^4.15.0",
"connect-redis": "^7.1.0",
"cookie": "^0.5.0",
"cookie-parser": "^1.4.6",
"cors": "^2.8.5",
"dotenv": "^16.0.3",
"express": "^4.18.2",
Expand All @@ -29,7 +28,6 @@
},
"devDependencies": {
"@types/cookie": "^0.5.1",
"@types/cookie-parser": "^1.4.3",
"@types/cors": "^2.8.13",
"@types/express": "^4.17.17",
"@types/express-session": "^1.17.6",
Expand Down
4 changes: 1 addition & 3 deletions src/index.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import RedisStore from "connect-redis";
import cookieParser from "cookie-parser";
import cors, { CorsOptions } from "cors";
import dotenv from "dotenv";
import express, { NextFunction, Request, Response } from "express";
Expand Down Expand Up @@ -61,7 +60,6 @@ const app = express();
app.disable("x-powered-by");
// Enable body parser
app.use(express.json());
app.use(cookieParser(COOKIE_SECRET));
app.set("trust proxy", 1);

const isProd = process.env.NODE_ENV === "production";
Expand All @@ -88,7 +86,7 @@ const corsOptions: CorsOptions = {
) {
callback(null, true);
} else {
callback(new Error("Not allowed by CORS"));
callback(new Error(`Origin ${origin} is not allowed by CORS`));
}
},
};
Expand Down

0 comments on commit b60b02f

Please sign in to comment.