From 8b589432290e9bafe508e61873dc206a6c6dcb7b Mon Sep 17 00:00:00 2001 From: DrJKL Date: Fri, 21 Nov 2025 14:11:31 -0800 Subject: [PATCH] fix: Clear apiKey on failed auth --- 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 77da8c41ba..b563a2f284 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'))