mirror of
https://github.com/Comfy-Org/ComfyUI_frontend.git
synced 2026-03-14 09:27:41 +00:00
## Summary - Temporarily remove email verification. After susbcription gating was enabled, this is less important - Will re-add the logic back at a later time, defering requirement until time to subscribe - For time being, typo emails can be resolved through custom service (https://support.comfy.org/hc/en-us/requests/new?tf_42243568391700=ccloud&tf_123456=X) - Keep the route and redirect for deprecation. Not really needed since the server falls back to root route anyway but generally good practice and is more resistant to future changes + avoids a single extra routing step in that scenario. ┆Issue is synchronized with this [Notion page](https://www.notion.so/PR-6366-remove-email-verification-temporarily-29b6d73d3650810095a4e7c4591b3327) by [Unito](https://www.unito.io)
187 lines
5.3 KiB
Vue
187 lines
5.3 KiB
Vue
<template>
|
|
<div class="flex h-full items-center justify-center p-8">
|
|
<div class="max-w-[100vw] p-2 lg:w-96">
|
|
<template v-if="!hasInviteCode">
|
|
<!-- Header -->
|
|
<div class="mt-6 mb-8 flex flex-col gap-4">
|
|
<h1 class="my-0 text-xl leading-normal font-medium">
|
|
{{ t('auth.login.title') }}
|
|
</h1>
|
|
<p class="my-0 text-base">
|
|
<span class="text-muted">{{ t('auth.login.newUser') }}</span>
|
|
<span
|
|
class="ml-1 cursor-pointer text-blue-500"
|
|
@click="navigateToSignup"
|
|
>{{ t('auth.login.signUp') }}</span
|
|
>
|
|
</p>
|
|
</div>
|
|
</template>
|
|
|
|
<template v-else>
|
|
<div class="mt-6 mb-8 flex flex-col gap-1">
|
|
<h1
|
|
class="font-abcrom my-0 text-2xl font-black text-white uppercase italic"
|
|
>
|
|
{{ t('cloudStart_invited') }}
|
|
</h1>
|
|
<p class="my-0 text-base">
|
|
<span class="text-muted">{{ t('cloudStart_invited_signin') }}</span>
|
|
</p>
|
|
</div>
|
|
</template>
|
|
|
|
<Message v-if="!isSecureContext" severity="warn" class="mb-4">
|
|
{{ t('auth.login.insecureContextWarning') }}
|
|
</Message>
|
|
|
|
<!-- Form -->
|
|
<CloudSignInForm :auth-error="authError" @submit="signInWithEmail" />
|
|
|
|
<!-- Divider -->
|
|
<Divider align="center" layout="horizontal" class="my-8">
|
|
<span class="text-muted">{{ t('auth.login.orContinueWith') }}</span>
|
|
</Divider>
|
|
|
|
<!-- Social Login Buttons -->
|
|
<div class="flex flex-col gap-6">
|
|
<Button
|
|
type="button"
|
|
class="h-10 bg-[#2d2e32]"
|
|
severity="secondary"
|
|
@click="signInWithGoogle"
|
|
>
|
|
<i class="pi pi-google mr-2"></i>
|
|
{{ t('auth.login.loginWithGoogle') }}
|
|
</Button>
|
|
|
|
<Button
|
|
type="button"
|
|
class="h-10 bg-[#2d2e32]"
|
|
severity="secondary"
|
|
@click="signInWithGithub"
|
|
>
|
|
<i class="pi pi-github mr-2"></i>
|
|
{{ t('auth.login.loginWithGithub') }}
|
|
</Button>
|
|
</div>
|
|
|
|
<!-- Terms & Contact -->
|
|
<p class="mt-5 text-sm text-gray-600">
|
|
{{ t('auth.login.termsText') }}
|
|
<a
|
|
href="https://www.comfy.org/terms-of-service"
|
|
target="_blank"
|
|
class="cursor-pointer text-blue-400 no-underline"
|
|
>
|
|
{{ t('auth.login.termsLink') }}
|
|
</a>
|
|
{{ t('auth.login.andText') }}
|
|
<a
|
|
href="https://www.comfy.org/privacy-policy"
|
|
target="_blank"
|
|
class="cursor-pointer text-blue-400 no-underline"
|
|
>
|
|
{{ t('auth.login.privacyLink') }} </a
|
|
>.
|
|
</p>
|
|
|
|
<template v-if="!hasInviteCode">
|
|
<p class="mt-5 text-sm text-gray-600">
|
|
{{ t('cloudWaitlist_questionsText') }}
|
|
<a
|
|
href="https://support.comfy.org"
|
|
class="cursor-pointer text-blue-400 no-underline"
|
|
target="_blank"
|
|
rel="noopener noreferrer"
|
|
>
|
|
{{ t('cloudWaitlist_contactLink') }}</a
|
|
>.
|
|
</p>
|
|
</template>
|
|
</div>
|
|
</div>
|
|
</template>
|
|
|
|
<script setup lang="ts">
|
|
import Button from 'primevue/button'
|
|
import Divider from 'primevue/divider'
|
|
import Message from 'primevue/message'
|
|
import { computed, ref } from 'vue'
|
|
import { useI18n } from 'vue-i18n'
|
|
import { useRoute, useRouter } from 'vue-router'
|
|
|
|
import { useFirebaseAuthActions } from '@/composables/auth/useFirebaseAuthActions'
|
|
import CloudSignInForm from '@/platform/onboarding/cloud/components/CloudSignInForm.vue'
|
|
import { useToastStore } from '@/platform/updates/common/toastStore'
|
|
import type { SignInData } from '@/schemas/signInSchema'
|
|
import { translateAuthError } from '@/utils/authErrorTranslation'
|
|
|
|
const { t } = useI18n()
|
|
const router = useRouter()
|
|
const route = useRoute()
|
|
const authActions = useFirebaseAuthActions()
|
|
const isSecureContext = window.isSecureContext
|
|
const authError = ref('')
|
|
const toastStore = useToastStore()
|
|
|
|
const hasInviteCode = computed(() => !!route.query.inviteCode)
|
|
|
|
const navigateToSignup = () => {
|
|
void router.push({ name: 'cloud-signup', query: route.query })
|
|
}
|
|
|
|
const onSuccess = async () => {
|
|
toastStore.add({
|
|
severity: 'success',
|
|
summary: 'Login Completed',
|
|
life: 2000
|
|
})
|
|
// Check if there's an invite code
|
|
const inviteCode = route.query.inviteCode as string | undefined
|
|
if (inviteCode) {
|
|
// Handle invite code flow - go to invite check
|
|
await router.push({
|
|
name: 'cloud-invite-check',
|
|
query: { inviteCode }
|
|
})
|
|
} else {
|
|
// Normal login flow - go to user check
|
|
await router.push({ name: 'cloud-user-check' })
|
|
}
|
|
}
|
|
|
|
// Custom error handler for inline display
|
|
const inlineErrorHandler = (error: unknown) => {
|
|
authError.value = translateAuthError(error)
|
|
authActions.reportError(error)
|
|
}
|
|
|
|
const signInWithGoogle = async () => {
|
|
authError.value = ''
|
|
if (await authActions.signInWithGoogle(inlineErrorHandler)()) {
|
|
await onSuccess()
|
|
}
|
|
}
|
|
|
|
const signInWithGithub = async () => {
|
|
authError.value = ''
|
|
if (await authActions.signInWithGithub(inlineErrorHandler)()) {
|
|
await onSuccess()
|
|
}
|
|
}
|
|
|
|
const signInWithEmail = async (values: SignInData) => {
|
|
authError.value = ''
|
|
if (
|
|
await authActions.signInWithEmail(
|
|
values.email,
|
|
values.password,
|
|
inlineErrorHandler
|
|
)()
|
|
) {
|
|
await onSuccess()
|
|
}
|
|
}
|
|
</script>
|