fix: RangeError: Incorrect locale information

fix/range-error
Udit Takkar 2023-10-13 23:06:09 +05:30
parent b076a7dabc
commit c7106e9075
1 changed files with 1 additions and 1 deletions

View File

@ -29,5 +29,5 @@ export const getLocale = async (req: GetTokenParams["req"]): Promise<string> =>
const languages = acceptLanguage ? parse(acceptLanguage) : [];
return languages[0]?.code || "en";
return languages.length === 1 && languages[0].code === "*" ? "en" : languages[0]?.code ?? "en";
};