mirror of
https://github.com/lukevella/rallly.git
synced 2025-08-03 00:19:03 +02:00
🐛 Fix matcher throwing error (#1634)
This commit is contained in:
parent
5bf579a62f
commit
f075c98f6e
3 changed files with 12 additions and 6 deletions
|
@ -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,
|
||||
|
|
|
@ -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}`;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue