diff --git a/CHANGELOG-DEV.md b/CHANGELOG-DEV.md index cafd59be22..aa27459075 100644 --- a/CHANGELOG-DEV.md +++ b/CHANGELOG-DEV.md @@ -87,3 +87,4 @@ HumHub Changelog - Chg #6174: Users allowed to manage settings can access to module configurations - Enh #6440: Sort user groups by `group.sort_order` and alphabetically - Enh #6454: Account deletion confirmation +- Enh #6458: Redirect to the latest-visited page after login or registration diff --git a/protected/humhub/controllers/ErrorController.php b/protected/humhub/controllers/ErrorController.php index 0f3a7b9d1c..b3cba0a7d9 100644 --- a/protected/humhub/controllers/ErrorController.php +++ b/protected/humhub/controllers/ErrorController.php @@ -53,6 +53,7 @@ class ErrorController extends Controller * Show special login required view for guests */ if (Yii::$app->user->isGuest && $exception instanceof HttpException && $exception->statusCode == '401' && AuthHelper::isGuestAccessEnabled()) { + Yii::$app->user->setReturnUrl(Yii::$app->request->getAbsoluteUrl()); return $this->render('@humhub/views/error/401_guests', ['message' => $message]); }