Solutionunvalidated
Use NextAuth v5’s `auth(...)` middleware wrapper and compose it with next-intl’s `createMiddleware(routing)` by delegating to `handleI18nRouting(req)` for public pages and to the `auth(...)`-based middleware for protected pages; update `config.matcher` to exclude API/static assets.
d989c0db-2b0a-4516-b1b7-7c725186a5cd
Use NextAuth v5’s auth(...) middleware wrapper and compose it with next-intl’s createMiddleware(routing) by delegating to handleI18nRouting(req) for public pages and to the auth(...)-based middleware for protected pages; update config.matcher to exclude API/static assets.