From 47cf1aff4a35048310c35cc8b29bab6444dc7570 Mon Sep 17 00:00:00 2001 From: NomenNescio Date: Mon, 4 Dec 2017 14:43:58 +0100 Subject: [PATCH] added configurable logout redirect URL --- app/views.py | 5 ++++- config_template.py | 2 ++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/app/views.py b/app/views.py index 09071f1..083c659 100644 --- a/app/views.py +++ b/app/views.py @@ -387,7 +387,10 @@ def logout(): session.pop('google_token', None) session.clear() logout_user() - return redirect(url_for('login')) + if app.config.get('SAML_LOGOUT_REDIRECT'): + return redirect(app.config.get('SAML_LOGOUT_REDIRECT')) + else: + return redirect(url_for('login')) @app.route('/dashboard', methods=['GET', 'POST']) diff --git a/config_template.py b/config_template.py index 0e79766..c08f2e4 100644 --- a/config_template.py +++ b/config_template.py @@ -92,6 +92,8 @@ SAML_METADATA_CACHE_LIFETIME = 1 SAML_SP_ENTITY_ID = 'http://' SAML_SP_CONTACT_NAME = '' SAML_SP_CONTACT_MAIL = '' +## uncomment to redirect to the given URL on logout +# SAML_LOGOUT_REDIRECT = 'https:///logout' #Default Auth BASIC_ENABLED = True