/**
  * Checks whether a specific user is currently logged in in the middleware
  *
  * @param string $username
  * @return bool
  */
 public function isUserLoggedIn($username)
 {
     try {
         $this->post('users/login_check', ['user' => $username]);
         if ($this->serviceResponse->getStatusCode() === 200) {
             return true;
         }
         $this->log("User login check failed: {$this->serviceResponse->getErrors()[0]}");
         return false;
     } catch (OAuthUnauthorizedException $e) {
         return false;
     } catch (AbstractHttpException $e) {
         return false;
     }
 }