/**
  *
  * Sets the user timeout status, and logs out if expired.
  *
  * @param Auth $auth An authentication tracker.
  *
  * @return bool
  *
  */
 protected function timedOut(Auth $auth)
 {
     if ($auth->isAnon()) {
         return false;
     }
     $timeout_status = $this->timer->getTimeoutStatus($auth->getFirstActive(), $auth->getLastActive());
     if ($timeout_status) {
         $auth->setStatus($timeout_status);
         $this->logout_service->logout($auth, $timeout_status);
         return true;
     }
     return false;
 }
Example #2
0
 /**
  * Attempt logout with underlying Aura\Auth service
  *
  * @param Auth   $auth   Aura\Auth current user representation
  * @param string $status Desired status after logout
  *
  * @return void
  *
  * @access protected
  */
 protected function logout(Auth $auth, $status = AuthStatus::ANON)
 {
     $this->auraLogout->logout($auth, $status);
 }