hotfix: missing locale

Nit
pull/11818/head v3.3.7
zomars 2023-10-10 15:32:22 -07:00
parent 38f389bce9
commit 4f942e1a13
1 changed files with 2 additions and 2 deletions

View File

@ -20,7 +20,7 @@ export const getLocale = async (req: GetTokenParams["req"]): Promise<string> =>
const tokenLocale = token?.["locale"]; const tokenLocale = token?.["locale"];
if (tokenLocale !== undefined) { if (tokenLocale) {
return tokenLocale; return tokenLocale;
} }
@ -29,5 +29,5 @@ export const getLocale = async (req: GetTokenParams["req"]): Promise<string> =>
const languages = acceptLanguage ? parse(acceptLanguage) : []; const languages = acceptLanguage ? parse(acceptLanguage) : [];
return languages[0]?.code ?? "en"; return languages[0]?.code || "en";
}; };