From af98484cb8fec637c03e0392c04606f624cf079d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20FAMIBELLE-PRONZOLA?= Date: Tue, 2 Jul 2024 11:07:01 +0200 Subject: [PATCH] Ensure verification password before submit register form --- app/register/form.js | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/app/register/form.js b/app/register/form.js index 214211a..2a597d3 100644 --- a/app/register/form.js +++ b/app/register/form.js @@ -11,6 +11,12 @@ export default function RegistrationForm() { const [isOpen, setIsOpen] = useState(false) const handleFormSubmit = async data => { + if (data.password_verification && data.password_verification !== data.password) { + setError('Les mots de passe ne correspondent pas !') + setIsOpen(true) + return + } + const response = await fetch('/api/auth/register', { method: 'POST', body: JSON.stringify({