returnhttperror.BadRequest("Existing password field specified without new password field.",errors.New("To change the password as an admin, you only need 'newPassword' in your request"))
}
returnhttperror.BadRequest("Existing password field specified without new password field.",errors.New("To change the password, you must include both 'password' and 'newPassword' in your request"))
}
ifpayload.NewPassword!=""{
// Non-admins need to supply the previous password