@Override
	public void setPassUser(String newPass, String oldPass) {
		UserDTO userDTO  = getUserConnected();
		
		if(userDTO == null){
			throw new IllegalArgumentException("User not connected.");
		}
		
		try {
			if( !usersManager.checkPassword(userDTO.getName(), oldPass)){
				throw new IllegalArgumentException("Password wrong.");
			}
			
			User user = usersManager.getUser(userDTO.getName());
			if(user == null){
				throw new IllegalArgumentException("Usuario no encontrado.");
			}
			
			usersManager.setPassword(user, newPass);
			
		} catch (Exception e) {
//			logger.error("Error change password user :" + e.getMessage());
			throw new IllegalStateException("Error changing password.");
		}
		
	}