I need to log in to the site using the API. with the API, I send $ _POST ['username'], $ _POST ['password'] to actionLogin ().
public function actionLogin() { if (!Yii::app()->user->isGuest) $this->redirect($this->createUrl('site/_allorders')); $model = new LoginForm; if (isset($_POST['LoginForm'])) { $model->attributes = $_POST['LoginForm']; if ($model->validate()) { $this->redirect(Yii::app()->user->returnUrl); } } $this->layout = 'mini'; $this->render('_loginForm', array('model' => $model)); } The $ model-> validate () method normally passes, but it fails to log in. What is my mistake or what is missing?
login()method? - Roman Grinyov