Answer the question
In order to leave comments, you need to log in
Why can't I authorize a user?
I uploaded it to the hosting and authorization works fine there, but, on the local computer, for some reason, authorization began to fail today
Writes an error
exception 'yii\web\BadRequestHttpException' with message 'Failed to check the transmitted data.' in C:\OpenServer\domains\hostTraining\vendor\yiisoft\yii2\web\Controller.php:166
What could be the problem?
In SiteController
public function actionLogin()
{
if (!Yii::$app->user->isGuest) {
return $this->redirect('index');
}
$model = new LoginForm();
if ($model->load(Yii::$app->request->post()) && $model->login()) {
return $this->goBack();
} else {
return $this->render('login', [
'model' => $model,
]);
}
}
Answer the question
In order to leave comments, you need to log in
Are you generating the form using standard means?
are you passing the csrf token?
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question