Refactored register page validation
This commit is contained in:
1 parent
5fbf5caec4
commit
54a10740be
4 files changed
+108
-77
No files matched your search
@@ -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;
|
||||
|
||||
Reference in new issue
Block a user