login-error-fix
This commit is contained in:
parent
75c7ef00f6
commit
1c02d3f29b
|
@ -97,7 +97,12 @@ export const LoginForm = () => {
|
||||||
const { errors } = await signIn({ email: email(), password: password() })
|
const { errors } = await signIn({ email: email(), password: password() })
|
||||||
console.error('[signIn errors]', errors)
|
console.error('[signIn errors]', errors)
|
||||||
if (errors?.length > 0) {
|
if (errors?.length > 0) {
|
||||||
if (errors.some((error) => error.message.includes('bad user credentials'))) {
|
if (
|
||||||
|
errors.some(
|
||||||
|
(error) =>
|
||||||
|
error.message.includes('bad user credentials') || error.message.includes('user not found'),
|
||||||
|
)
|
||||||
|
) {
|
||||||
setValidationErrors((prev) => ({
|
setValidationErrors((prev) => ({
|
||||||
...prev,
|
...prev,
|
||||||
password: t('Something went wrong, check email and password'),
|
password: t('Something went wrong, check email and password'),
|
||||||
|
|
|
@ -61,7 +61,12 @@ export const SendResetLinkForm = () => {
|
||||||
redirect_uri: window.location.origin,
|
redirect_uri: window.location.origin,
|
||||||
})
|
})
|
||||||
console.debug('[SendResetLinkForm] authorizer response:', data)
|
console.debug('[SendResetLinkForm] authorizer response:', data)
|
||||||
if (errors?.some((error) => error.message.includes('bad user credentials'))) {
|
if (
|
||||||
|
errors?.some(
|
||||||
|
(error) =>
|
||||||
|
error.message.includes('bad user credentials') || error.message.includes('user not found'),
|
||||||
|
)
|
||||||
|
) {
|
||||||
setIsUserNotFound(true)
|
setIsUserNotFound(true)
|
||||||
}
|
}
|
||||||
if (data.message) setMessage(data.message)
|
if (data.message) setMessage(data.message)
|
||||||
|
|
|
@ -57,6 +57,7 @@ export const HeaderAuth = (props: Props) => {
|
||||||
toggleEditorPanel()
|
toggleEditorPanel()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// FIXME: use or remove
|
||||||
const handleSaveClick = () => {
|
const handleSaveClick = () => {
|
||||||
const hasTopics = form.selectedTopics?.length > 0
|
const hasTopics = form.selectedTopics?.length > 0
|
||||||
if (hasTopics) {
|
if (hasTopics) {
|
||||||
|
|
Loading…
Reference in New Issue
Block a user