From 6146fa51088bfeb14663ebcff893760ff4f1cc44 Mon Sep 17 00:00:00 2001 From: Tom Milewski Date: Tue, 23 Jul 2024 14:24:08 -0400 Subject: [PATCH] fix(chrome-extension): Appropriately handle fulfilled, but null, cookie promises --- .changeset/ninety-toes-fix.md | 5 +++++ packages/chrome-extension/src/utils/cookies.ts | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) create mode 100644 .changeset/ninety-toes-fix.md diff --git a/.changeset/ninety-toes-fix.md b/.changeset/ninety-toes-fix.md new file mode 100644 index 00000000000..2db4cdbc388 --- /dev/null +++ b/.changeset/ninety-toes-fix.md @@ -0,0 +1,5 @@ +--- +"@clerk/chrome-extension": patch +--- + +Appropriately handle fulfilled, but null, cookie promises diff --git a/packages/chrome-extension/src/utils/cookies.ts b/packages/chrome-extension/src/utils/cookies.ts index 754a4d910aa..bdf861bf443 100644 --- a/packages/chrome-extension/src/utils/cookies.ts +++ b/packages/chrome-extension/src/utils/cookies.ts @@ -25,7 +25,7 @@ export async function getClientCookie({ urls, name }: GetClientCookieParams) { const cookieResults = await Promise.allSettled(cookiePromises); for (const cookie of cookieResults) { - if (cookie.status === 'fulfilled') { + if (cookie.status === 'fulfilled' && cookie.value) { return cookie.value; } }