From 4f942e1a13531b4bff43fe80c9b0f5e2a3147dd4 Mon Sep 17 00:00:00 2001 From: zomars Date: Tue, 10 Oct 2023 15:32:22 -0700 Subject: [PATCH] hotfix: missing locale Nit --- packages/features/auth/lib/getLocale.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/features/auth/lib/getLocale.ts b/packages/features/auth/lib/getLocale.ts index cfd494a3f2..ec77edab69 100644 --- a/packages/features/auth/lib/getLocale.ts +++ b/packages/features/auth/lib/getLocale.ts @@ -20,7 +20,7 @@ export const getLocale = async (req: GetTokenParams["req"]): Promise => const tokenLocale = token?.["locale"]; - if (tokenLocale !== undefined) { + if (tokenLocale) { return tokenLocale; } @@ -29,5 +29,5 @@ export const getLocale = async (req: GetTokenParams["req"]): Promise => const languages = acceptLanguage ? parse(acceptLanguage) : []; - return languages[0]?.code ?? "en"; + return languages[0]?.code || "en"; };