Ensure verification password before submit register form

This commit is contained in:
2024-07-02 11:07:01 +02:00
parent da911120e8
commit af98484cb8
+6
View File
@@ -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({