Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 14 additions & 2 deletions src/components/dialog/content/SignInContent.vue
Original file line number Diff line number Diff line change
Expand Up @@ -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">
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we can always show the divider here, tie it to the email signin/up form state is probably not so necessary.

Expand Down Expand Up @@ -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'
Expand Down Expand Up @@ -127,4 +134,9 @@ const signUpWithEmail = async (values: SignUpData) => {
onSuccess()
}
}

const userIsInChina = ref(false)
onMounted(async () => {
userIsInChina.value = await isInChina()
})
</script>
3 changes: 2 additions & 1 deletion src/locales/en/main.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
1 change: 1 addition & 0 deletions src/locales/es/main.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
1 change: 1 addition & 0 deletions src/locales/fr/main.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
1 change: 1 addition & 0 deletions src/locales/ja/main.json
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@
"emailPlaceholder": "メールアドレスを入力してください",
"passwordLabel": "パスワード",
"passwordPlaceholder": "新しいパスワードを入力してください",
"regionRestrictionChina": "現地の規制要件に従い、当社のサービスは現在中国本土のユーザーにはご利用いただけません。",
"signIn": "サインイン",
"signUpButton": "サインアップ",
"signUpWithGithub": "Githubでサインアップ",
Expand Down
1 change: 1 addition & 0 deletions src/locales/ko/main.json
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@
"emailPlaceholder": "이메일을 입력하세요",
"passwordLabel": "비밀번호",
"passwordPlaceholder": "새 비밀번호를 입력하세요",
"regionRestrictionChina": "현지 규제 요건에 따라, 본 서비스는 현재 중국 본토에 위치한 사용자에게 제공되지 않습니다.",
"signIn": "로그인",
"signUpButton": "가입하기",
"signUpWithGithub": "Github로 가입하기",
Expand Down
1 change: 1 addition & 0 deletions src/locales/ru/main.json
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@
"emailPlaceholder": "Введите вашу электронную почту",
"passwordLabel": "Пароль",
"passwordPlaceholder": "Введите новый пароль",
"regionRestrictionChina": "В соответствии с местными нормативными требованиями наши услуги в настоящее время недоступны для пользователей, находящихся в материковом Китае.",
"signIn": "Войти",
"signUpButton": "Зарегистрироваться",
"signUpWithGithub": "Зарегистрироваться через Github",
Expand Down
1 change: 1 addition & 0 deletions src/locales/zh/main.json
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@
"emailPlaceholder": "输入您的电子邮件",
"passwordLabel": "密码",
"passwordPlaceholder": "输入新密码",
"regionRestrictionChina": "根据当地法规要求,我们目前无法为中国大陆地区的用户提供服务。",
"signIn": "登录",
"signUpButton": "注册",
"signUpWithGithub": "使用Github注册",
Expand Down