komentiranje koda

This commit is contained in:
2024-02-16 17:12:08 +01:00
parent 3240f746d1
commit 50692ee6fe

View File

@@ -25,7 +25,10 @@ export default async function middleware(req: NextRequest) {
); );
const isPublicPage = publicPathnameRegex.test(req.nextUrl.pathname); const isPublicPage = publicPathnameRegex.test(req.nextUrl.pathname);
// for punlic pages we call only localisation middleware // for public pages we call only localisation middleware
// this is not an official way to do it - it's a hack
// based on https://github.com/nextauthjs/next-auth/discussions/8961
// The official way of chaining middlewares in AuthJS v5 does not work and is not fully documented
if (!isPublicPage) { if (!isPublicPage) {
const session = await auth(); const session = await auth();