Skip to content
This repository was archived by the owner on Apr 26, 2024. It is now read-only.

Commit 116a895

Browse files
committed
Render sso deactived/success templates
We switched from reading them directly from disk to making them into jinja2.Template files, which broke stuff. We now render them to turn them back into text.
1 parent d35c049 commit 116a895

File tree

1 file changed

+11
-4
lines changed

1 file changed

+11
-4
lines changed

synapse/config/sso.py

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -29,23 +29,30 @@ def read_config(self, config, **kwargs):
2929
# The sso-specific template_dir
3030
template_dir = sso_config.get("template_dir")
3131

32+
# Read templates from disk
3233
(
33-
self.sso_account_deactivated_template,
34-
self.sso_auth_success_template,
3534
self.sso_redirect_confirm_template,
3635
self.sso_auth_confirm_template,
3736
self.sso_error_template,
37+
sso_account_deactivated_template,
38+
sso_auth_success_template,
3839
) = self.read_templates(
3940
[
40-
"sso_account_deactivated.html",
41-
"sso_auth_success.html",
4241
"sso_redirect_confirm.html",
4342
"sso_auth_confirm.html",
4443
"sso_error.html",
44+
"sso_account_deactivated.html",
45+
"sso_auth_success.html",
4546
],
4647
template_dir,
4748
)
4849

50+
# These templates have no placeholders, so render them here
51+
self.sso_account_deactivated_template = (
52+
sso_account_deactivated_template.render()
53+
)
54+
self.sso_auth_success_template = sso_auth_success_template.render()
55+
4956
self.sso_client_whitelist = sso_config.get("client_whitelist") or []
5057

5158
# Attempt to also whitelist the server's login fallback, since that fallback sets

0 commit comments

Comments
 (0)