logout() public method

Logs the current user out.
public logout ( Cartalyst\Sentinel\Users\UserInterface $user = null, boolean $everywhere = false ) : boolean
$user Cartalyst\Sentinel\Users\UserInterface
$everywhere boolean
return boolean
Esempio n. 1
0
 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();
 }
Esempio n. 2
0
 /**
  * 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);
 }
Esempio n. 3
0
 /**
  * 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);
 }
Esempio n. 4
0
 /**
  * {@inheritDoc}
  */
 public function logout()
 {
     return $this->sentinel->logout();
 }