From f5608435b4dc08a6bf2ff290f21f4a2facddc35b Mon Sep 17 00:00:00 2001 From: Alexander Brown Date: Fri, 21 Nov 2025 16:26:39 -0800 Subject: [PATCH] Fix: Clear apiKey on failed auth (#6816) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ## Summary Handles the case where an API key is structurally valid but not in our DB. ┆Issue is synchronized with this [Notion page](https://www.notion.so/PR-6816-Fix-Clear-apiKey-on-failed-auth-2b26d73d3650817ab34edfa380795178) by [Unito](https://www.unito.io) --- src/stores/apiKeyAuthStore.ts | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/stores/apiKeyAuthStore.ts b/src/stores/apiKeyAuthStore.ts index 77da8c41b..b563a2f28 100644 --- a/src/stores/apiKeyAuthStore.ts +++ b/src/stores/apiKeyAuthStore.ts @@ -24,7 +24,12 @@ export const useApiKeyAuthStore = defineStore('apiKeyAuth', () => { const isAuthenticated = computed(() => !!currentUser.value) const initializeUserFromApiKey = async () => { - const createCustomerResponse = await firebaseAuthStore.createCustomer() + const createCustomerResponse = await firebaseAuthStore + .createCustomer() + .catch((err) => { + console.error(err) + return + }) if (!createCustomerResponse) { apiKey.value = null throw new Error(t('auth.login.noAssociatedUser'))