code: public function beforeAction($action)
      {
          if (parent::beforeAction($action)) {
              if ($this->enableCsrfValidation && Yii::$app->getErrorHandler()->exception === null && !Yii::$app->getRequest()->validateCsrfToken()) {
                  throw new BadRequestHttpException(Yii::t('yii', 'Unable to verify your data submission.'));
              }
  
              return true;
          }
  
          return false;
      }
docs: {@inheritdoc}