Skip to content

Commit

Permalink
fix: probes not using intl
Browse files Browse the repository at this point in the history
  • Loading branch information
etiennecl committed Mar 12, 2024
1 parent 70878b5 commit ba64f90
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 45 deletions.
12 changes: 0 additions & 12 deletions src/app/layout.tsx

This file was deleted.

17 changes: 0 additions & 17 deletions src/app/not-found.tsx

This file was deleted.

6 changes: 0 additions & 6 deletions src/app/page.tsx

This file was deleted.

21 changes: 11 additions & 10 deletions src/middleware.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import { withMiddlewareAuthRequired } from '@/lib/auth/edge';
import createMiddleware from 'next-intl/middleware';
import { NextFetchEvent, NextRequest } from 'next/server';

Expand All @@ -7,18 +8,18 @@ const intlMiddleware = createMiddleware({
localePrefix: 'never',
});

export default function middleware(req: NextRequest, _event: NextFetchEvent) {
// // We skip the next-intl middleware for the auth page as it is not translated
// // and the locale parameter is conflicting with the auth0 route handlers.
// // As the auth0 route handlers are not translated, we can safely skip it.
// const isAuthPage = req.nextUrl.pathname.startsWith('/auth');
export default function middleware(req: NextRequest, event: NextFetchEvent) {
// We skip the next-intl middleware for the auth page as it is not translated
// and the locale parameter is conflicting with the auth0 route handlers.
// As the auth0 route handlers are not translated, we can safely skip it.
const isAuthPage = req.nextUrl.pathname.startsWith('/auth');

// if (isAuthPage) {
// return withMiddlewareAuthRequired()(req, event);
// }
return intlMiddleware(req);
if (isAuthPage) {
return withMiddlewareAuthRequired()(req, event);
}
return withMiddlewareAuthRequired(intlMiddleware)(req, event);
}

export const config = {
matcher: ['/((?!api|_next|_vercel|.*\\..*).*)'],
matcher: ['/((?!api|_next|livez|healthz|_vercel|.*\\..*).*)'],
};

0 comments on commit ba64f90

Please sign in to comment.