/** * */ public function action_logout() { if (!\Registry::getCurrentUser()->isGuest()) { \Auth\Base::destroy(); } \HTTP::redirect(\Route::get('SystemRoute')->uri(['controller' => 'Main', 'action' => 'Login']), 302); }
/** * @return bool */ public function action_logout() { header('Content-type: application/json'); $t = \Auth\Base::destroy(); if ($t) { $this->response->body(json_encode(['code' => 1])); } else { $this->response->body(json_encode(['code' => 0])); } }