From bf2cdae3b15605acc87e47cee679c28cac8f298b Mon Sep 17 00:00:00 2001 From: Felix Eckhofer Date: Thu, 26 Aug 2021 18:40:12 +0200 Subject: [PATCH] Add PAPERLESS_LOGOUT_REDIRECT_URL When set, the user is redirected to this URL after a logout. Especially useful in conjunction with PAPERLESS_ENABLE_HTTP_REMOTE_USER and SSO. --- docs/configuration.rst | 7 +++++++ src/paperless/settings.py | 1 + 2 files changed, 8 insertions(+) diff --git a/docs/configuration.rst b/docs/configuration.rst index c5bb811f6..27ace497b 100644 --- a/docs/configuration.rst +++ b/docs/configuration.rst @@ -233,6 +233,13 @@ PAPERLESS_HTTP_REMOTE_USER_HEADER_NAME= Defaults to `HTTP_REMOTE_USER`. +PAPERLESS_LOGOUT_REDIRECT_URL= + URL to redirect the user to after a logout. This can be used together with + `PAPERLESS_ENABLE_HTTP_REMOTE_USER` to redirect the user back to the SSO + application's logout page. + + Defaults to None, which disables this feature. + .. _configuration-ocr: OCR settings diff --git a/src/paperless/settings.py b/src/paperless/settings.py index 5f03a406e..805b1aec0 100644 --- a/src/paperless/settings.py +++ b/src/paperless/settings.py @@ -144,6 +144,7 @@ def __get_boolean(key, default="NO"): FORCE_SCRIPT_NAME = os.getenv("PAPERLESS_FORCE_SCRIPT_NAME") BASE_URL = (FORCE_SCRIPT_NAME or "") + "/" LOGIN_URL = BASE_URL + "accounts/login/" +LOGOUT_REDIRECT_URL = os.getenv("PAPERLESS_LOGOUT_REDIRECT_URL") WSGI_APPLICATION = 'paperless.wsgi.application' ASGI_APPLICATION = "paperless.asgi.application"