mirror of
https://github.com/Comfy-Org/ComfyUI_frontend.git
synced 2026-04-20 14:30:41 +00:00
## Summary Rename `useFirebaseAuthStore` → `useAuthStore` and `FirebaseAuthStoreError` → `AuthStoreError`. Introduce shared mock factory (`authStoreMock.ts`) to replace 16 independent bespoke mocks. ## Changes - **What**: Mechanical rename of store, composable, class, and store ID (`firebaseAuth` → `auth`). Created `src/stores/__tests__/authStoreMock.ts` — a shared mock factory with reactive controls, used by all consuming test files. Migrated all 16 test files from ad-hoc mocks to the shared factory. - **Files**: 62 files changed (rename propagation + new test infra) ## Review Focus - Mock factory API design in `authStoreMock.ts` — covers all store properties with reactive `controls` for per-test customization - Self-test in `authStoreMock.test.ts` validates computed reactivity Fixes #8219 ## Stack This is PR 1/5 in a stacked refactoring series: 1. **→ This PR**: Rename + shared test fixtures 2. #10484: Extract auth-routing from workspaceApi 3. #10485: Auth token priority tests 4. #10486: Decompose MembersPanelContent 5. #10487: Consolidate SubscriptionTier type --------- Co-authored-by: Alexander Brown <drjkl@comfy.org>
94 lines
2.9 KiB
Vue
94 lines
2.9 KiB
Vue
<template>
|
|
<div class="flex h-full items-center justify-center p-6">
|
|
<div class="max-w-[100vw] text-center lg:w-[500px]">
|
|
<h2 class="mb-3 text-xl text-text-primary">
|
|
{{ $t('cloudOnboarding.authTimeout.title') }}
|
|
</h2>
|
|
<p class="mb-5 text-muted">
|
|
{{ $t('cloudOnboarding.authTimeout.message') }}
|
|
</p>
|
|
|
|
<!-- Troubleshooting Section -->
|
|
<div class="mb-4 rounded-sm bg-secondary-background px-3 py-2 text-left">
|
|
<h3 class="mb-2 text-sm font-semibold text-text-primary">
|
|
{{ $t('cloudOnboarding.authTimeout.troubleshooting') }}
|
|
</h3>
|
|
<ul class="space-y-1.5 text-sm text-muted">
|
|
<li
|
|
v-for="(cause, index) in $tm('cloudOnboarding.authTimeout.causes')"
|
|
:key="index"
|
|
class="flex gap-2"
|
|
>
|
|
<span>•</span>
|
|
<span>{{ cause }}</span>
|
|
</li>
|
|
</ul>
|
|
</div>
|
|
|
|
<!-- Technical Details (Collapsible) -->
|
|
<div v-if="errorMessage" class="mb-4 text-left">
|
|
<button
|
|
class="flex w-full items-center justify-between rounded-sm border-0 bg-secondary-background px-4 py-2 text-sm text-text-secondary transition-colors hover:bg-secondary-background-hover"
|
|
@click="showTechnicalDetails = !showTechnicalDetails"
|
|
>
|
|
<span>{{ $t('cloudOnboarding.authTimeout.technicalDetails') }}</span>
|
|
<i
|
|
:class="[
|
|
'pi',
|
|
showTechnicalDetails ? 'pi-chevron-up' : 'pi-chevron-down'
|
|
]"
|
|
></i>
|
|
</button>
|
|
<div
|
|
v-if="showTechnicalDetails"
|
|
class="mt-2 rounded-sm border border-muted-background p-4 font-mono text-xs break-all text-muted-foreground"
|
|
>
|
|
{{ errorMessage }}
|
|
</div>
|
|
</div>
|
|
|
|
<!-- Helpful Links -->
|
|
<p class="mb-5 text-center text-sm text-gray-600">
|
|
{{ $t('cloudOnboarding.authTimeout.helpText') }}
|
|
<a
|
|
href="https://support.comfy.org"
|
|
class="cursor-pointer text-blue-400 no-underline"
|
|
target="_blank"
|
|
rel="noopener noreferrer"
|
|
>
|
|
{{ $t('cloudOnboarding.authTimeout.supportLink') }}</a
|
|
>.
|
|
</p>
|
|
|
|
<div class="flex flex-col gap-3">
|
|
<Button class="w-full" @click="handleRestart">
|
|
{{ $t('cloudOnboarding.authTimeout.restart') }}
|
|
</Button>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</template>
|
|
|
|
<script setup lang="ts">
|
|
import { ref } from 'vue'
|
|
import { useRouter } from 'vue-router'
|
|
|
|
import Button from '@/components/ui/button/Button.vue'
|
|
import { useAuthActions } from '@/composables/auth/useAuthActions'
|
|
|
|
interface Props {
|
|
errorMessage?: string
|
|
}
|
|
|
|
defineProps<Props>()
|
|
|
|
const router = useRouter()
|
|
const { logout } = useAuthActions()
|
|
const showTechnicalDetails = ref(false)
|
|
|
|
const handleRestart = async () => {
|
|
await logout()
|
|
await router.replace({ name: 'cloud-login' })
|
|
}
|
|
</script>
|