Refactored register page validation

This commit is contained in:
Daniel Cojocea committed 2024-07-15 18:47:23 -04:00
1 parent 5fbf5caec4
commit 54a10740be
4 files changed
+108 -77

No files matched your search

+2 -2
View File
@@ -62,8 +62,8 @@ const credentials = joi.object({
"string.empty": "Password confirmation is required",
})
.custom((value, helpers) => {
const { newPassword } = helpers.prefs.context;
if (value !== newPassword) {
const { password } = helpers.prefs.context;
if (value !== password) {
return helpers.message("Passwords do not match");
}
return value;