Good day
There is almost a standard action for the user registration.
After you save the user I want to authenticate. But autentifici not working.
if (!Yii::$app->user->isGuest) {
return $this->redirect(['/order/client']);
}
$model = new SignupForm();
if ($model->load(Yii::$app->request->post())) {
if ($user = $model->signup()) {
Yii::$app->user->login($user);
Yii::$app->getSession()->setFlash('success', 'Confirm you email address');
$redirectUrl = Yii::$app->request->get('redirect');
if ($redirectUrl) {
return $this->redirect(urldecode($redirectUrl));
}
return $this->refresh();
}
}
return $this->render('signup', [
'model' => $model,
]);
After the redirect the user is not authenticated. I can not understand in what business.
Model klementinum user interface yii\web\IdentityInterface
enableSession
included? Need more information, logs show that in the debug panel. - Rosanna.Ha commented on June 14th 19 at 19:12