From c7106e9075fa7c6d401637e953165f2c9b077718 Mon Sep 17 00:00:00 2001 From: Udit Takkar Date: Fri, 13 Oct 2023 23:06:09 +0530 Subject: [PATCH] fix: RangeError: Incorrect locale information --- packages/features/auth/lib/getLocale.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/features/auth/lib/getLocale.ts b/packages/features/auth/lib/getLocale.ts index ec77edab69..9fad1bb7c4 100644 --- a/packages/features/auth/lib/getLocale.ts +++ b/packages/features/auth/lib/getLocale.ts @@ -29,5 +29,5 @@ export const getLocale = async (req: GetTokenParams["req"]): Promise => const languages = acceptLanguage ? parse(acceptLanguage) : []; - return languages[0]?.code || "en"; + return languages.length === 1 && languages[0].code === "*" ? "en" : languages[0]?.code ?? "en"; };