mirror of
https://github.com/humhub/humhub.git
synced 2025-01-17 14:18:27 +01:00
Fix automatically login user after registration (#6294)
* Fix automatically login user after registration * Update RegistrationController.php --------- Co-authored-by: Lucas Bartholemy <luke-@users.noreply.github.com>
This commit is contained in:
parent
8861a580c4
commit
a0408aa38f
@ -12,6 +12,7 @@ HumHub Changelog
|
||||
- Enh #6242: Submit button hidden when editing a comment having a long "code" line
|
||||
- Fix #6282: Hard delete content records on integrity check
|
||||
- Fix #6257: Fix error after publishing of a draft content
|
||||
- Fix #6273: Fix automatically login user after registration
|
||||
- Fix #6292: Messages: Notification Indicator Problem
|
||||
- Fix #6296: Update style variable `background-color-secondary`
|
||||
|
||||
|
@ -89,8 +89,8 @@ class RegistrationController extends Controller
|
||||
|
||||
// Autologin when user is enabled (no approval required)
|
||||
if ($registration->getUser()->status === User::STATUS_ENABLED) {
|
||||
Yii::$app->user->switchIdentity($registration->models['User']);
|
||||
$registration->models['User']->updateAttributes(['last_login' => date('Y-m-d G:i:s')]);
|
||||
$registration->getUser()->refresh(); // https://github.com/humhub/humhub/issues/6273
|
||||
Yii::$app->user->login($registration->getUser());
|
||||
if (Yii::$app->request->getIsAjax()) {
|
||||
return $this->htmlRedirect(Yii::$app->user->returnUrl);
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user