protected function updateUserLogin(Entity\Users $userEntity)
    {
        $userEntity->setLastseen(Carbon::now());
        $userEntity->setLastip($this->getClientIp());
        $userEntity->setFailedlogins(0);
        $userEntity->setThrottleduntil($this->throttleUntil(0));
        $userEntity = $this->updateUserShadowLogin($userEntity);

        // Don't try to save the password on login
        $userEntity->setPassword(null);
        try {
            $saved = $this->getRepositoryUsers()->save($userEntity);
        } catch (NotNullConstraintViolationException $e) {
            // Database needs updating
            $saved = true;
        }
        if ($saved) {
            $this->flashLogger->success(Trans::__("You've been logged on successfully."));

            return true;
        }

        return false;
    }