fix: Clear apiKey on failed auth

This commit is contained in:
DrJKL
2025-11-21 14:11:31 -08:00
parent a8d6f7baff
commit 8b58943229

View File

@@ -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'))