core/modules/user/src/Plugin/Menu/LoginLogoutMenuLink.php | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/core/modules/user/src/Plugin/Menu/LoginLogoutMenuLink.php b/core/modules/user/src/Plugin/Menu/LoginLogoutMenuLink.php index a5d3240..a722e4b 100644 --- a/core/modules/user/src/Plugin/Menu/LoginLogoutMenuLink.php +++ b/core/modules/user/src/Plugin/Menu/LoginLogoutMenuLink.php @@ -87,11 +87,12 @@ public function getRouteName() { public function getOptions() { $options = parent::getOptions(); - // Ensure that after logging in or out, the user is redirected to the - // current page. + // Ensure that after logging in, the user is redirected to the current page. // @see system_page_attachments() // @see \Drupal\Core\EventSubscriber\CurrentPathDestinationLinkResponseFilter - $options['attributes']['data-current-path-destination'] = TRUE; + if (!$this->currentUser->isAuthenticated()) { + $options['attributes']['data-current-path-destination'] = TRUE; + } return $options; }