public function logout($destroySession = true) { if (!$this->getIsGuest()) { /** @type IdentityAuthTrait $identity */ $identity = $this->getIdentity(); return $identity->deleteToken($this->tokenType); } return parent::logout($destroySession); }