🐛 Fix matcher throwing error (#1634)

This commit is contained in:
Luke Vella 2025-03-14 13:35:51 +00:00 committed by GitHub
parent 5bf579a62f
commit f075c98f6e
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 12 additions and 6 deletions

View file

@ -19,7 +19,7 @@ const handler = async (req: NextRequest) => {
req,
router: appRouter,
createContext: async () => {
const locale = await getPreferredLocale(req);
const locale = getPreferredLocale(req);
const user = session?.user
? {
id: session.user.id,

View file

@ -25,7 +25,7 @@ export const middleware = withAuth(async (req) => {
newUrl.pathname = `/${locale}${newUrl.pathname}`;
} else {
// Check if locale is specified in header
locale = await getPreferredLocale(req);
locale = getPreferredLocale(req);
newUrl.pathname = `/${locale}${newUrl.pathname}`;
}