fix: error in login on console

This commit is contained in:
Caio Cabral committed 2024-10-31 15:05:43 -04:00
1 parent 7bb8f94ecc
commit b0c66b0a1d
1 file changed
+2 -9
@@ -8,10 +8,7 @@ import Check from "../../../../Components/Check/Check";
import { useValidatePassword } from "../../hooks/useValidatePassword"; import { useValidatePassword } from "../../hooks/useValidatePassword";
StepThree.propTypes = { StepThree.propTypes = {
form: PropTypes.object,
errors: PropTypes.object,
onSubmit: PropTypes.func, onSubmit: PropTypes.func,
/* onChange: PropTypes.func, */
onBack: PropTypes.func, onBack: PropTypes.func,
}; };
@@ -19,10 +16,7 @@ StepThree.propTypes = {
* Renders the third step of the sign up process. * Renders the third step of the sign up process.
* *
* @param {Object} props * @param {Object} props
* @param {Object} props.form - Form state object.
* @param {Object} props.errors - Object containing form validation errors.
* @param {Function} props.onSubmit - Callback function to handle form submission. * @param {Function} props.onSubmit - Callback function to handle form submission.
* @param {Function} props.onChange - Callback function to handle form input changes.
* @param {Function} props.onBack - Callback function to handle "Back" button click. * @param {Function} props.onBack - Callback function to handle "Back" button click.
* @returns {JSX.Element} * @returns {JSX.Element}
*/ */
@@ -37,7 +31,6 @@ function StepThree({ onSubmit, onBack }) {
}, []); }, []);
const { handleChange, feedbacks, form, errors } = useValidatePassword(); const { handleChange, feedbacks, form, errors } = useValidatePassword();
return ( return (
<> <>
<Stack <Stack
@@ -72,7 +65,7 @@ function StepThree({ onSubmit, onBack }) {
autoComplete="current-password" autoComplete="current-password"
value={form.password} value={form.password}
onChange={handleChange} onChange={handleChange}
error={errors.password} error={errors.password[0]}
ref={inputRef} ref={inputRef}
/> />
<Field <Field
@@ -85,7 +78,7 @@ function StepThree({ onSubmit, onBack }) {
autoComplete="current-password" autoComplete="current-password"
value={form.confirm} value={form.confirm}
onChange={handleChange} onChange={handleChange}
error={errors.confirm} error={errors.confirm[0]}
/> />
<Stack <Stack
gap={theme.spacing(4)} gap={theme.spacing(4)}