fixed cors bug, separating rental confirmation for owner and renter, removing condition checks from my-listings

This commit is contained in:
jackiettran
2025-10-08 23:03:28 -04:00
parent 052781a0e6
commit 34c0ad2920
5 changed files with 249 additions and 94 deletions

View File

@@ -73,10 +73,7 @@ app.use(morgan("combined", { stream: logger.stream }));
// API request/response logging
app.use("/api/", apiLogger);
// General rate limiting for all routes
app.use("/api/", generalLimiter);
// CORS with security settings
// CORS with security settings (must come BEFORE rate limiter to ensure headers on all responses)
app.use(
cors({
origin: process.env.FRONTEND_URL || "http://localhost:3000",
@@ -85,6 +82,9 @@ app.use(
})
);
// General rate limiting for all routes
app.use("/api/", generalLimiter);
// Body parsing with size limits
app.use(
bodyParser.json({