mirror of
https://github.com/Comfy-Org/ComfyUI_frontend.git
synced 2026-01-26 19:09:52 +00:00
Fix: Clear apiKey on failed auth (#6816)
## 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)
This commit is contained in:
@@ -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'))
|
||||
|
||||
Reference in New Issue
Block a user