public function getLogout() { try { if (!!($user = $this->sentinel->check())) { $this->setResponseData($this->sentinel->logout(null, true)); } else { throw new \Exception("Can't get current user"); } } catch (\Exception $e) { $this->setErrorData($e->getMessage()); } return $this->responseJson(); }
/** * Logs the current user out. * * @param User $user * @param bool $everywhere * * @return bool */ public function logout(User $user = null, $everywhere = false) { return $this->sentinel->logout($user, $everywhere); }
/** * Logs the current user out. * * @param \Cartalyst\Sentinel\Users\UserInterface $user * @param bool $everywhere * @return bool * @static */ public static function logout($user = null, $everywhere = false) { return \Cartalyst\Sentinel\Sentinel::logout($user, $everywhere); }
/** * {@inheritDoc} */ public function logout() { return $this->sentinel->logout(); }