forgot-form-fox

This commit is contained in:
Untone 2024-01-31 16:54:43 +03:00
parent 90cf0a9e10
commit 27711d7e99

View File

@ -65,21 +65,16 @@ export const ForgotPasswordForm = () => {
email: email(), email: email(),
redirect_uri: window.location.origin, redirect_uri: window.location.origin,
}) })
if (data) {
console.debug('[ForgotPasswordForm] authorizer response:', data) console.debug('[ForgotPasswordForm] authorizer response:', data)
setMessage(data.message) setMessage(data.message)
}
if (errors) {
console.warn(errors) console.warn(errors)
if (errors) { if (errors.some((e) => e.cause === 'user_not_found')) {
const error: Error = errors[0]
if (error.cause === 'user_not_found') {
setIsUserNotFound(true) setIsUserNotFound(true)
return return
} else { } else {
setSubmitError(error.message) const errorText = errors.map((e) => e.message).join(' ') // FIXME
} setSubmitError(errorText)
}
} }
} catch (error) { } catch (error) {
console.error(error) console.error(error)