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(); }
public function postRemoveCustomDataById(Request $request) { try { $data = $this->getRequestData($request); if (!!($user = $this->sentinel->check())) { $this->setResponseData($this->userCustomerDataModel->removeCustomDataById($data['id'], $user)); } else { throw new \Exception("Can't get current user"); } } catch (\Exception $e) { $this->setErrorData($e->getMessage()); } return $this->responseJson(); }
/** * Checks to see if a user is logged in. * * @return User|bool */ public function check() { return $this->sentinel->check(); }
/** * Checks to see if a user is logged in. * * @return \Cartalyst\Sentinel\Users\UserInterface|bool * @static */ public static function check() { return \Cartalyst\Sentinel\Sentinel::check(); }