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