Merge pull request #3718 from funkycram/patch-4

Update RegistrationController.php
This commit is contained in:
Lucas Bartholemy 2019-11-03 20:00:53 +01:00 committed by GitHub
commit ec66148eaa
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -77,7 +77,10 @@ class RegistrationController extends Controller
if ($registration->getUser()->status === User::STATUS_ENABLED) {
Yii::$app->user->switchIdentity($registration->models['User']);
$registration->models['User']->updateAttributes(['last_login' => new \yii\db\Expression('NOW()')]);
return $this->redirect(['/']);
if (Yii::$app->request->getIsAjax()) {
return $this->htmlRedirect(Yii::$app->user->returnUrl);
}
return $this->redirect(Yii::$app->user->returnUrl);
}
return $this->render('success', [