OAuth: Fix bug where it was impossible to login again after logout (#10073)

This commit is contained in:
Aleksander Machniak
2026-01-25 12:26:43 +01:00
parent 343c6a0c2d
commit 75dbc2fe11
2 changed files with 2 additions and 1 deletions

View File

@@ -7,6 +7,7 @@ This file includes only changes we consider noteworthy for users, admins and plu
- Support `request_url` config option for resolving relative URLs (#9868)
- Support X-Forwarded-Host/X-Forwarded-Port in self URLs generation (#9952)
- Support $HasAttachment/$HasNoAttachment keywords for "With attachment" search filter (#10053)
- OAuth: Fix bug where it was impossible to login again after logout (#10073)
- Managesieve: Fix handling of string-list format values for date tests in Out of Office (#10075)
- Password: Extend Dovecot passwdfile driver with dynamic file path support (#10036)
- Fix a UI issue on using browser Back button after allowing remote resources (#10062)

View File

@@ -1347,7 +1347,7 @@ class rcmail_oauth
// We store just the query string (not full URL) so it can be used directly with $_POST['_url']
if (!empty($_SERVER['QUERY_STRING']) && !$this->rcmail->output->ajax_call) {
// Only store if it's not a login or oauth action (prevents redirect loops)
if (!preg_match('/(_task=login|_action=oauth)/', $_SERVER['QUERY_STRING'])) {
if (!preg_match('/(_task=login|_task=logout|_action=oauth)/', $_SERVER['QUERY_STRING'])) {
$_SESSION['oauth_redirect_uri'] = $_SERVER['QUERY_STRING'];
$this->log_debug('storing original query string for post-auth redirect: %s', $_SERVER['QUERY_STRING']);
}