UserEntity userEntity = userRepository.findByCredentials(email,
passwordHash);
User user = DozerHelper.map(userEntity, User.class);
SessionEntity sessionEntity = sessionRepository.findByUserId(user
.getId());
// Creating or updating user's session
Session session = createOrUpdateSession(user, sessionEntity);