Skip to content

Commit

Permalink
Merge pull request #11 from fga-eps-mds/15_bugfix_passwords
Browse files Browse the repository at this point in the history
bugfix: The passwords match.
  • Loading branch information
Matheusafonsouza authored Jan 10, 2025
2 parents f31a2e9 + 801f566 commit a8ea159
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion src/pages/SignUp/SignUpForm/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,12 @@ function SignUpForm() {
register,
handleSubmit,
formState: { errors, isValid },
watch,
} = useForm<FormValues>();




const { signUp, isAuthenticated } = useAuth();

const onSubmit = handleSubmit(async (data: FormValues) => {
Expand Down Expand Up @@ -100,7 +104,10 @@ function SignUpForm() {
<PasswordInput
size={'2xl'}
placeholder={'Confirmar senha'}
{...register('passwordConfirmation', { required: "Campo obrigatório." })}
{...register('passwordConfirmation', { required: "Campo obrigatório.",
validate: (value) =>
value === watch('password') || "As senhas não correspondem."
})}
/>
</Field>
</Stack>
Expand Down

0 comments on commit a8ea159

Please sign in to comment.