move chage password to user con
This commit is contained in:
parent
ff5b189b2f
commit
a6cddc6318
6 changed files with 85 additions and 57 deletions
|
|
@ -120,7 +120,7 @@ export const changePasswordSchema = Joi.object({
|
|||
|
||||
export const resetRequestSchema = Joi.object({
|
||||
email: Joi.string()
|
||||
.email()
|
||||
.email({ tlds: { allow: false } }) // Allow any TLD including .local
|
||||
.required()
|
||||
.messages({
|
||||
'string.email': 'Please provide a valid email address',
|
||||
|
|
|
|||
|
|
@ -22,14 +22,22 @@ export const profileUpdateSchema = Joi.object({
|
|||
});
|
||||
|
||||
export const changePasswordSchema = Joi.object({
|
||||
old_password: Joi.string()
|
||||
oldPassword: Joi.string()
|
||||
.min(6)
|
||||
.max(100)
|
||||
.required()
|
||||
.messages({
|
||||
'string.min': 'Old password must be at least 6 characters',
|
||||
'string.max': 'Old password must not exceed 100 characters',
|
||||
'any.required': 'Old password is required'
|
||||
}),
|
||||
new_password: Joi.string()
|
||||
newPassword: Joi.string()
|
||||
.min(6)
|
||||
.max(100)
|
||||
.required()
|
||||
.messages({
|
||||
'string.min': 'New password must be at least 6 characters',
|
||||
'string.max': 'New password must not exceed 100 characters',
|
||||
'any.required': 'New password is required'
|
||||
})
|
||||
});
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue