komentiranje koda
This commit is contained in:
@@ -25,7 +25,10 @@ export default async function middleware(req: NextRequest) {
|
||||
);
|
||||
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) {
|
||||
const session = await auth();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user