The middleware was deleted in the Next.js 16 upgrade but is still required by next-intl to handle locale detection and URL rewriting. Without it, /auth/sign-in can't resolve to [locale=de]/auth/sign-in → 404. Uses createMiddleware from next-intl/middleware with the shared routing config.
16 lines
366 B
TypeScript
16 lines
366 B
TypeScript
import createMiddleware from 'next-intl/middleware';
|
|
|
|
import { routing } from '@kit/i18n/routing';
|
|
|
|
export default createMiddleware(routing);
|
|
|
|
export const config = {
|
|
matcher: [
|
|
// Match all pathnames except:
|
|
// - API routes (/api/...)
|
|
// - Next.js internals (/_next/...)
|
|
// - Static files with extensions
|
|
'/((?!api|_next|.*\\..*).*)',
|
|
],
|
|
};
|