[ 'class' => AccessControl::className(), 'only' => ['login-info'], 'rules' => [ [ 'actions' => ['login-info'], 'allow' => true, 'roles' => ['?'], ], ], ], ]); } public function verbs() { return [ 'loginInfo' => ['post'], ]; } public function actionLoginInfo() { $model = new AuthenticationForm(); $model->load(Yii::$app->request->post()); if (!$model->login()) { return [ 'success' => false, 'errors' => $model->getErrors(), ]; } return [ 'success' => true, ]; } }