From 1fc4d175ac83990a08da56b324e456e849f2d111 Mon Sep 17 00:00:00 2001 From: Slavi Pantaleev Date: Mon, 23 Dec 2024 21:02:21 +0200 Subject: [PATCH] Simplify logout_redirect_url templating and make it safer Using `to_json` to make it safer. Judging by the code here https://github.com/element-hq/element-web/blob/0b24d33c64e5a161621f68fa8da65aaa8d1c847d/src/Lifecycle.ts#L1026-L1032 it doesn't seem like it leaving `logout_redirect_url` empty will hurt, so this patch removes the `if` block. --- roles/custom/matrix-client-element/templates/config.json.j2 | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/roles/custom/matrix-client-element/templates/config.json.j2 b/roles/custom/matrix-client-element/templates/config.json.j2 index dbd2a9bfa..9d354a3c2 100644 --- a/roles/custom/matrix-client-element/templates/config.json.j2 +++ b/roles/custom/matrix-client-element/templates/config.json.j2 @@ -40,9 +40,7 @@ {% if matrix_client_element_location_sharing_enabled %} "map_style_url": {{ matrix_client_element_map_style_url | to_json }}, {% endif %} - {% if matrix_client_element_logout_redirect_url != '' %} - "logout_redirect_url": "{{ matrix_client_element_logout_redirect_url }}", - {% endif %} + "logout_redirect_url": {{ matrix_client_element_logout_redirect_url | to_json }}, "branding": { "auth_footer_links": {{ matrix_client_element_branding_auth_footer_links | to_json }}, "auth_header_logo_url": {{ matrix_client_element_branding_auth_header_logo_url | to_json }},