From c22d406d12174f66ec732908afa5437007e05ad5 Mon Sep 17 00:00:00 2001 From: Hariom Balhara Date: Fri, 29 Sep 2023 16:20:15 +0530 Subject: [PATCH] Enforce CSP on /login as well (#11610) --- apps/web/middleware.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/apps/web/middleware.ts b/apps/web/middleware.ts index 8156b41c39..8f8b8da78f 100644 --- a/apps/web/middleware.ts +++ b/apps/web/middleware.ts @@ -40,7 +40,7 @@ const middleware: NextMiddleware = async (req) => { requestHeaders.set("x-cal-timezone", req.headers.get("x-vercel-ip-timezone") ?? ""); } - if (url.pathname.startsWith("/auth/login")) { + if (url.pathname.startsWith("/auth/login") || url.pathname.startsWith("/login")) { // Use this header to actually enforce CSP, otherwise it is running in Report Only mode on all pages. requestHeaders.set("x-csp-enforce", "true"); } @@ -68,6 +68,7 @@ export const config = { matcher: [ "/:path*/embed", "/api/trpc/:path*", + "/login", "/auth/login", /** * Paths required by routingForms.handle