chore: clean up config.matcher in middleware (#18638)
Co-authored-by: Alex van Andel <me@alexvanandel.com>
This commit is contained in:
co-authored by
Alex van Andel
parent
14151b827f
commit
07085b9ffb
@@ -2,7 +2,6 @@ import { _generateMetadata, getTranslate } from "app/_utils";
|
||||
import { WithLayout } from "app/layoutHOC";
|
||||
import { headers } from "next/headers";
|
||||
import Link from "next/link";
|
||||
import { redirect } from "next/navigation";
|
||||
|
||||
import {
|
||||
getOrgDomainConfigFromHostname,
|
||||
@@ -53,9 +52,10 @@ async function NotFound() {
|
||||
const host = headersList.get("x-forwarded-host") ?? "";
|
||||
const pathname = headersList.get("x-pathname") ?? "";
|
||||
|
||||
if (!pathname) {
|
||||
redirect("/500");
|
||||
}
|
||||
// This makes more sense after full migration to App Router
|
||||
// if (!pathname) {
|
||||
// redirect("/500");
|
||||
// }
|
||||
|
||||
const { username, pageType, url } = getPageInfo(pathname, host);
|
||||
const isBookingSuccessPage = pathname?.startsWith("/booking");
|
||||
|
||||
+1
-11
@@ -171,15 +171,11 @@ export const config = {
|
||||
"/api/auth/signup",
|
||||
"/api/trpc/:path*",
|
||||
"/login",
|
||||
"/auth/:path*",
|
||||
"/auth/login",
|
||||
"/apps/:path*",
|
||||
"/event-types/:path*",
|
||||
"/workflows/:path*",
|
||||
"/getting-started/:path*",
|
||||
"/workflows/:path*",
|
||||
"/getting-started/:path*",
|
||||
"/event-types/:path*",
|
||||
"/apps/:path*",
|
||||
"/routing/:path*",
|
||||
"/bookings/:path*",
|
||||
"/video/:path*",
|
||||
@@ -189,13 +185,7 @@ export const config = {
|
||||
"/reschedule/:path*",
|
||||
"/availability/:path*",
|
||||
"/booking/:path*",
|
||||
"/payment/:path*",
|
||||
"/router/:path*",
|
||||
"/routing-forms/:path*",
|
||||
"/org/:path*",
|
||||
"/team/:path*",
|
||||
"/:user/:type/",
|
||||
"/:user/",
|
||||
],
|
||||
};
|
||||
|
||||
|
||||
@@ -85,8 +85,6 @@ CustomError.getInitialProps = async (ctx: AugmentedNextPageContext) => {
|
||||
log.debug(`server side logged this: ${err?.toString() ?? JSON.stringify(err)}`);
|
||||
log.info("return props, ", errorInitialProps);
|
||||
|
||||
res.setHeader("x-pages-router-error", "true");
|
||||
|
||||
return errorInitialProps;
|
||||
} else {
|
||||
// Running on the client (browser).
|
||||
|
||||
Reference in New Issue
Block a user