Middleware rewrite shenanigans

This commit is contained in:
zomars committed 2022-08-16 13:59:38 -06:00
1 parent 4f76654813
commit 79d37676fc
2 files changed
+11 -2

No files matched your search

+2 -2
View File
@@ -19,8 +19,8 @@ const middleware: NextMiddleware = async (req) => {
(callbackUrl && ![CONSOLE_URL, WEBAPP_URL, WEBSITE_URL].some((u) => callbackUrl.startsWith(u)))
) {
// DDOS Prevention: Immediately end request with no response - Avoids a redirect as well initiated by NextAuth on invalid callback
const res = new NextResponse("hey", { status: 400, statusText: "Please don't" });
return res;
req.nextUrl.pathname = "/api/nope";
return NextResponse.redirect(req.nextUrl);
}
}
/** Display available V2 pages to users who opted-in to early access */