Logout should be successful and redirect to the selected logout redirection page
The /logout.html should redirect to something like /index.php?option=com_users&task=user.logout....&return=...
the logout.html redirects to /joomla/index.php?option=com_users&task=user.logout....&return=... which results in a 404 because the /joomla prefix should not be there
The user is not logged out
Joomla 4.2.8, PHP 8.0.27
Linux ms11720 3.10.0-1160.62.1.el7.x86_64 #1 SMP Tue Apr 5 16:57:59 UTC 2022 x86_64 x86_64 x86_64 GNU/Linux
Shared Hoster
I was able to fix this by changing the setRedirect in function menuLogout in file joomla/components/com_users/src/Controller/UserController.php from:
$this->setRedirect('index.php?option=com_users&task=user.logout&' . Session::getFormToken() . '=1&return=' . base64_encode($url));
to this
$this->setRedirect(Route::_('index.php?option=com_users&task=user.logout&' . Session::getFormToken() . '=1&return=' . base64_encode($url), false));
Labels |
Added:
No Code Attached Yet
|
Ok, I was just stating how the site is setup. I removed the RewriteBase and the error is still the same. So I removed this step in the reproduction description.
Your problem is that you have installed joomla in a subdirectory but you have the domain name pointing to the parent folder.
Either move the installation to the parent folder or change the server config to point to the correct folder and not to the parent
Labels |
Added:
bug
|
@joomdonation it seems that its about 50/50 the usage of Route::_
with setRedirect
@brianteeman I just tried to scan the code and see that most of the url passed to setRedirect
call is wrapped with Route::_
already (especially when in is none sef URL with format index.php?option=com_......)
There are some setRedirect
calls with Uri:root()
or Uri::base()
, it does not need to use Route::_
because these are absolute URLs (return site's URL) already.
So @Hackwar please look at the URL here to see if we should uses Route::_
as suggested by the author of this issue.
Status | New | ⇒ | Closed |
Closed_Date | 0000-00-00 00:00:00 | ⇒ | 2024-02-24 11:28:26 |
Closed_By | ⇒ | joomdonation |
Just checked again and found that the Route::_ call is already applied to the URL, see https://github.com/joomla/joomla-cms/blob/4.4-dev/components/com_users/src/Controller/UserController.php#L206, so the issue is fixed now. I'm closing this.
that was wrong and not needed