diff --git a/core/admin/mailu/configuration.py b/core/admin/mailu/configuration.py index b958537c..4f3f8e84 100644 --- a/core/admin/mailu/configuration.py +++ b/core/admin/mailu/configuration.py @@ -86,6 +86,7 @@ DEFAULT_CONFIG = { 'PROXY_AUTH_WHITELIST': '', 'PROXY_AUTH_HEADER': 'X-Auth-Email', 'PROXY_AUTH_CREATE': False, + 'PROXY_AUTH_LOGOUT_URL': None, 'SUBNET': '192.168.203.0/24', 'SUBNET6': None, } diff --git a/core/admin/mailu/sso/views/base.py b/core/admin/mailu/sso/views/base.py index f8fd5e10..0375117b 100644 --- a/core/admin/mailu/sso/views/base.py +++ b/core/admin/mailu/sso/views/base.py @@ -57,7 +57,7 @@ def login(): def logout(): flask_login.logout_user() flask.session.destroy() - response = flask.redirect(flask.url_for('.login')) + response = flask.redirect(app.config('PROXY_AUTH_LOGOUT_URL') or flask.url_for('.login')) for cookie in ['roundcube_sessauth', 'roundcube_sessid', 'smsession']: response.set_cookie(cookie, 'empty', expires=0) return response diff --git a/docs/configuration.rst b/docs/configuration.rst index abb0860d..d1175f3f 100644 --- a/docs/configuration.rst +++ b/docs/configuration.rst @@ -377,4 +377,6 @@ Use ``PROXY_AUTH_HEADER`` (default: 'X-Auth-Email') to customize which HTTP head Once configured, any request to /sso/proxy will be redirected to the webmail and /sso/proxy/admin to the admin panel. Please check issue `1972` for more details. +Use ``PROXY_AUTH_LOGOUT_URL`` (default: unset) to redirect users to a specific URL after they have been logged out. + .. _`1972`: https://github.com/Mailu/Mailu/issues/1972 diff --git a/towncrier/newsfragments/2692.misc b/towncrier/newsfragments/2692.misc new file mode 100644 index 00000000..4d2937a7 --- /dev/null +++ b/towncrier/newsfragments/2692.misc @@ -0,0 +1,2 @@ +Make the login page "guess" where the user wants to land using the Referer header +Introduce AUTH_PROXY_LOGOUT_URL to redirect users to a specific URL after they have been logged-out