[API Node] Conditional signup render (#3653)

Co-authored-by: github-actions <github-actions@github.com>
Co-authored-by: Chenlei Hu <hcl@comfy.org>
This commit is contained in:
Christian Byrne
2025-04-27 18:47:17 -07:00
committed by GitHub
parent c6cb3f0a33
commit 96d954ceb2
8 changed files with 22 additions and 3 deletions

View File

@@ -19,7 +19,12 @@
<!-- Form -->
<SignInForm v-if="isSignIn" @submit="signInWithEmail" />
<SignUpForm v-else @submit="signUpWithEmail" />
<template v-else>
<Message v-if="userIsInChina" severity="warn" class="mb-4">
{{ t('auth.signup.regionRestrictionChina') }}
</Message>
<SignUpForm v-else @submit="signUpWithEmail" />
</template>
<!-- Divider -->
<Divider align="center" layout="horizontal" class="my-8">
@@ -84,11 +89,13 @@
<script setup lang="ts">
import Button from 'primevue/button'
import Divider from 'primevue/divider'
import { ref } from 'vue'
import Message from 'primevue/message'
import { onMounted, ref } from 'vue'
import { useI18n } from 'vue-i18n'
import { SignInData, SignUpData } from '@/schemas/signInSchema'
import { useFirebaseAuthService } from '@/services/firebaseAuthService'
import { isInChina } from '@/utils/networkUtil'
import SignInForm from './signin/SignInForm.vue'
import SignUpForm from './signin/SignUpForm.vue'
@@ -127,4 +134,9 @@ const signUpWithEmail = async (values: SignUpData) => {
onSuccess()
}
}
const userIsInChina = ref(false)
onMounted(async () => {
userIsInChina.value = await isInChina()
})
</script>

View File

@@ -1125,7 +1125,8 @@
"signUpButton": "Sign up",
"signIn": "Sign in",
"signUpWithGoogle": "Sign up with Google",
"signUpWithGithub": "Sign up with Github"
"signUpWithGithub": "Sign up with Github",
"regionRestrictionChina": "In accordance with local regulatory requirements, our services are currently unavailable to users located in mainland China."
},
"signOut": {
"signOut": "Log Out",

View File

@@ -46,6 +46,7 @@
"emailPlaceholder": "Ingresa tu correo electrónico",
"passwordLabel": "Contraseña",
"passwordPlaceholder": "Ingresa una nueva contraseña",
"regionRestrictionChina": "De acuerdo con los requisitos regulatorios locales, nuestros servicios no están disponibles actualmente para usuarios ubicados en China continental.",
"signIn": "Iniciar sesión",
"signUpButton": "Registrarse",
"signUpWithGithub": "Registrarse con Github",

View File

@@ -46,6 +46,7 @@
"emailPlaceholder": "Entrez votre email",
"passwordLabel": "Mot de passe",
"passwordPlaceholder": "Entrez un nouveau mot de passe",
"regionRestrictionChina": "Conformément aux exigences réglementaires locales, nos services ne sont actuellement pas disponibles pour les utilisateurs situés en Chine continentale.",
"signIn": "Se connecter",
"signUpButton": "S'inscrire",
"signUpWithGithub": "S'inscrire avec Github",

View File

@@ -46,6 +46,7 @@
"emailPlaceholder": "メールアドレスを入力してください",
"passwordLabel": "パスワード",
"passwordPlaceholder": "新しいパスワードを入力してください",
"regionRestrictionChina": "現地の規制要件に従い、当社のサービスは現在中国本土のユーザーにはご利用いただけません。",
"signIn": "サインイン",
"signUpButton": "サインアップ",
"signUpWithGithub": "Githubでサインアップ",

View File

@@ -46,6 +46,7 @@
"emailPlaceholder": "이메일을 입력하세요",
"passwordLabel": "비밀번호",
"passwordPlaceholder": "새 비밀번호를 입력하세요",
"regionRestrictionChina": "현지 규제 요건에 따라, 본 서비스는 현재 중국 본토에 위치한 사용자에게 제공되지 않습니다.",
"signIn": "로그인",
"signUpButton": "가입하기",
"signUpWithGithub": "Github로 가입하기",

View File

@@ -46,6 +46,7 @@
"emailPlaceholder": "Введите вашу электронную почту",
"passwordLabel": "Пароль",
"passwordPlaceholder": "Введите новый пароль",
"regionRestrictionChina": "В соответствии с местными нормативными требованиями наши услуги в настоящее время недоступны для пользователей, находящихся в материковом Китае.",
"signIn": "Войти",
"signUpButton": "Зарегистрироваться",
"signUpWithGithub": "Зарегистрироваться через Github",

View File

@@ -46,6 +46,7 @@
"emailPlaceholder": "输入您的电子邮件",
"passwordLabel": "密码",
"passwordPlaceholder": "输入新密码",
"regionRestrictionChina": "根据当地法规要求,我们目前无法为中国大陆地区的用户提供服务。",
"signIn": "登录",
"signUpButton": "注册",
"signUpWithGithub": "使用Github注册",