auth-errors-fix
This commit is contained in:
parent
135e0d215f
commit
22f0c9052d
|
@ -417,6 +417,7 @@
|
||||||
"Username": "Username",
|
"Username": "Username",
|
||||||
"Userpic": "Userpic",
|
"Userpic": "Userpic",
|
||||||
"Users": "Users",
|
"Users": "Users",
|
||||||
|
"User was not found": "User was not found",
|
||||||
"Video format not supported": "Video format not supported",
|
"Video format not supported": "Video format not supported",
|
||||||
"Video": "Video",
|
"Video": "Video",
|
||||||
"Views": "Views",
|
"Views": "Views",
|
||||||
|
|
|
@ -549,6 +549,7 @@
|
||||||
"topicKeywords": "{topic}, Discours.io, статьи, журналистика, исследования",
|
"topicKeywords": "{topic}, Discours.io, статьи, журналистика, исследования",
|
||||||
"topics": "темы",
|
"topics": "темы",
|
||||||
"user already exist": "пользователь уже существует",
|
"user already exist": "пользователь уже существует",
|
||||||
|
"User was not found": "Пользователь не найден",
|
||||||
"verified": "уже подтверждён",
|
"verified": "уже подтверждён",
|
||||||
"video": "видео",
|
"video": "видео",
|
||||||
"view": "просмотр",
|
"view": "просмотр",
|
||||||
|
|
|
@ -96,18 +96,14 @@ export const LoginForm = () => {
|
||||||
try {
|
try {
|
||||||
const { errors } = await signIn({ email: email(), password: password() })
|
const { errors } = await signIn({ email: email(), password: password() })
|
||||||
if (errors?.length > 0) {
|
if (errors?.length > 0) {
|
||||||
console.debug('[signIn] errors:', errors)
|
console.error('[signIn errors]', errors)
|
||||||
if (
|
if (errors.some((error) => error.message.includes('user has not signed up email & password'))) {
|
||||||
errors.some(
|
|
||||||
(error) => error.message.includes('bad user credentials') || error.message.includes('user not'),
|
|
||||||
)
|
|
||||||
) {
|
|
||||||
setValidationErrors((prev) => ({
|
setValidationErrors((prev) => ({
|
||||||
...prev,
|
...prev,
|
||||||
password: t('Something went wrong, check email and password'),
|
password: t('Something went wrong, check email and password'),
|
||||||
}))
|
}))
|
||||||
} else if (errors.some((error) => error.message.includes('user not found'))) {
|
} else if (errors.some((error) => error.message.includes('user not found'))) {
|
||||||
setSubmitError('Пользователь не найден')
|
setSubmitError(t('User was not found'))
|
||||||
} else if (errors.some((error) => error.message.includes('email not verified'))) {
|
} else if (errors.some((error) => error.message.includes('email not verified'))) {
|
||||||
setSubmitError(
|
setSubmitError(
|
||||||
<div class={styles.info}>
|
<div class={styles.info}>
|
||||||
|
|
Loading…
Reference in New Issue
Block a user