Skip to content

Commit

Permalink
ar(feat) [DPCP-37]: Localization
Browse files Browse the repository at this point in the history
  • Loading branch information
angeloreale committed Aug 21, 2024
1 parent 6af7f15 commit 450d4da
Showing 1 changed file with 3 additions and 9 deletions.
12 changes: 3 additions & 9 deletions src/middleware.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,20 +7,14 @@ import { i18nDetectMiddleware } from './middlewares/i18nDetectMiddleware';
export const middlewares = [authMiddleware, i18nDetectMiddleware];

export const config = {
matcher: [
'/api/:path*',
'/(default|cs-cz|de-de|en|es-es|et-ee|fr-fr|it-it|ja-jp|pl-pl|ro|ru-ru|sv-se)/:path*',
'/((?!_next).*)/',
],
matcher: ['/api/:path*', '/(default|cs-cz|de-de|en|es-es|et-ee|fr-fr|it-it|ja-jp|pl-pl|ro|ru-ru|sv-se)/:path*'],
};

const blocklist = [
'_next'
]
const blocklist = ['_next'];

export default async function middleware(request: NextRequest) {
if (blocklist.some((pattern) => request?.nextUrl?.pathname?.includes(pattern))) {
return NextResponse.next()
return NextResponse.next();
}
// if a response is returned, return it otherwise call `next()`
for (const fn of middlewares) {
Expand Down

0 comments on commit 450d4da

Please sign in to comment.