Merged in chore/more-partner-sas-boilerplate (pull request #2756)

chore: Misc for partner-sas

* Add global-error to partner-sas

* Add redirect to lang in partner-sas

* Actually use language from param

* Increase test timeouts and use parsed lang to fix tests

* Remove need to import serverClient to setup trpc


Approved-by: Hrishikesh Vaipurkar
This commit is contained in:
Anton Gunnarsson
2025-09-04 07:45:14 +00:00
parent 36b6685ad5
commit 7e585b2d9a
9 changed files with 162 additions and 26 deletions

View File

@@ -23,16 +23,11 @@ export const middleware: NextMiddleware = async (request, event) => {
// Default to English if no lang is found.
headers.set("x-lang", Lang.en)
return NextResponse.rewrite(
new URL(`/${Lang.en}/middleware-error/404`, request.nextUrl),
{
request: {
headers,
},
status: 404,
statusText: "Not found",
}
)
return NextResponse.next({
request: {
headers,
},
})
}
// Note that the order of middlewares is important since that is the order they are matched by.