From 387ff966a992efe7ff78df4cb233b1a2f9815f24 Mon Sep 17 00:00:00 2001 From: Bruno Windels Date: Tue, 2 Feb 2021 15:15:25 +0100 Subject: [PATCH 01/20] same font for input fields --- synapse/res/templates/sso.css | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/synapse/res/templates/sso.css b/synapse/res/templates/sso.css index 46b309ea4e83..1d104f64dac2 100644 --- a/synapse/res/templates/sso.css +++ b/synapse/res/templates/sso.css @@ -1,4 +1,4 @@ -body { +body, input, select, textarea { font-family: "Inter", "Helvetica", "Arial", sans-serif; font-size: 14px; color: #17191C; From c8fd44d3468e1156dd1733b654f305dbce4a0a3c Mon Sep 17 00:00:00 2001 From: Bruno Windels Date: Tue, 2 Feb 2021 15:15:56 +0100 Subject: [PATCH 02/20] show correct outline on userid input --- .../templates/sso_auth_account_details.html | 31 +++++++++++++++++-- 1 file changed, 28 insertions(+), 3 deletions(-) diff --git a/synapse/res/templates/sso_auth_account_details.html b/synapse/res/templates/sso_auth_account_details.html index 105063825a92..e4c6c6eaaae1 100644 --- a/synapse/res/templates/sso_auth_account_details.html +++ b/synapse/res/templates/sso_auth_account_details.html @@ -4,9 +4,26 @@ Synapse Login + -
-

{{ server_name }} Login

- -
+ + {% include "sso_footer.html" without context %} From c1d475accb553a01b91c388adb8b96bd55510b50 Mon Sep 17 00:00:00 2001 From: Richard van der Hoff Date: Tue, 2 Feb 2021 16:50:37 +0000 Subject: [PATCH 10/20] changelog --- changelog.d/9301.feature | 1 + 1 file changed, 1 insertion(+) create mode 100644 changelog.d/9301.feature diff --git a/changelog.d/9301.feature b/changelog.d/9301.feature new file mode 100644 index 000000000000..a2d0b27da47a --- /dev/null +++ b/changelog.d/9301.feature @@ -0,0 +1 @@ +Further improvements to the user experience of registration via single sign-on. From 80924bc33fd499d00026c718fa181ff4b9aa0953 Mon Sep 17 00:00:00 2001 From: Bruno Windels Date: Tue, 2 Feb 2021 18:44:53 +0100 Subject: [PATCH 11/20] better title for uia confirm --- synapse/res/templates/sso_auth_confirm.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/synapse/res/templates/sso_auth_confirm.html b/synapse/res/templates/sso_auth_confirm.html index 97823f455b2b..f9d0456f0a46 100644 --- a/synapse/res/templates/sso_auth_confirm.html +++ b/synapse/res/templates/sso_auth_confirm.html @@ -2,7 +2,7 @@ - Authentication + Confirm it's you @@ -19,17 +20,17 @@

Log in

Continue to confirm you trust {{ display_url }}.

- {% if user_profile.avatar_url %} -
+
+ {% if user_profile.avatar_url %} -
- {% if user_profile.display_name %} + {% endif %} + {% if user_profile.display_name %}
{{ user_profile.display_name }}
- {% endif %} -
{{ user_id }}
-
+ {% else %} +
{{ user_id.split(":")[1:] }}
+ {% endif %} +
{{ user_id }}
- {% endif %} Continue
{% include "sso_footer.html" without context %} From cf36c47e18e3fde41f96ff8bd4aae8a567c7f2e0 Mon Sep 17 00:00:00 2001 From: Bruno Windels Date: Wed, 3 Feb 2021 12:50:08 +0100 Subject: [PATCH 15/20] improve continue if you trust page design --- .../res/templates/sso_redirect_confirm.html | 27 ++++++++++++++----- 1 file changed, 20 insertions(+), 7 deletions(-) diff --git a/synapse/res/templates/sso_redirect_confirm.html b/synapse/res/templates/sso_redirect_confirm.html index 20d5879a0157..d31396e04722 100644 --- a/synapse/res/templates/sso_redirect_confirm.html +++ b/synapse/res/templates/sso_redirect_confirm.html @@ -7,17 +7,29 @@
- {% if new_user %} -

Your account is now ready

-

You've made your account on {{ server_name }}.

- {% else %} -

Log in

- {% endif %} -

Continue to confirm you trust {{ display_url }}.

+

Continue to your account

@@ -31,6 +43,7 @@

Log in

{% endif %}
{{ user_id }}
+

Continuing will grant {{ display_url }} access to your account.

Continue
{% include "sso_footer.html" without context %} From 6a0cdb91ea15a3b7e4b36ff5c95d3cbf64e22bc3 Mon Sep 17 00:00:00 2001 From: Bruno Windels Date: Wed, 3 Feb 2021 12:54:21 +0100 Subject: [PATCH 16/20] make header take up a bit more space, especially on larger screens --- synapse/res/templates/sso.css | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/synapse/res/templates/sso.css b/synapse/res/templates/sso.css index 99fa1ad240c2..338214f5d012 100644 --- a/synapse/res/templates/sso.css +++ b/synapse/res/templates/sso.css @@ -11,6 +11,16 @@ header, footer { text-align: center; } +@media screen and (min-width: 800px) { + header { + margin-top: 90px; + } +} + +header { + min-height: 60px; +} + header p { color: #737D8C; line-height: 24px; From 571418c5c0c68e161e5855bb4c52da1c2ad53221 Mon Sep 17 00:00:00 2001 From: Richard van der Hoff Date: Wed, 3 Feb 2021 12:19:45 +0000 Subject: [PATCH 17/20] Update display_url for redirect confirm --- synapse/handlers/auth.py | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/synapse/handlers/auth.py b/synapse/handlers/auth.py index a19c5564377a..648fe91f53b5 100644 --- a/synapse/handlers/auth.py +++ b/synapse/handlers/auth.py @@ -1472,10 +1472,22 @@ def _complete_sso_login( # Remove the query parameters from the redirect URL to get a shorter version of # it. This is only to display a human-readable URL in the template, but not the # URL we redirect users to. - redirect_url_no_params = client_redirect_url.split("?")[0] + url_parts = urllib.parse.urlsplit(client_redirect_url) + + if url_parts.scheme == "https": + # for an https uri, just show the netloc (ie, the hostname. Specifically, + # the bit between "//" and "/"; this includes any potential + # "username:password@" prefix.) + display_url = url_parts.netloc + else: + # for other uris, strip the query-params (including the login token) and + # fragment. + display_url = urllib.parse.urlunsplit( + (url_parts.scheme, url_parts.netloc, url_parts.path, "", "") + ) html = self._sso_redirect_confirm_template.render( - display_url=redirect_url_no_params, + display_url=display_url, redirect_url=redirect_url, server_name=self._server_name, new_user=new_user, From 7db023ac9be701d9c8d657a7c29058eb9ba695fd Mon Sep 17 00:00:00 2001 From: Richard van der Hoff Date: Wed, 3 Feb 2021 19:27:45 +0000 Subject: [PATCH 18/20] fix user-id to displayname, and factor out to common file --- .../res/templates/sso_new_user_consent.html | 12 +----------- .../res/templates/sso_partial_profile.html | 19 +++++++++++++++++++ .../res/templates/sso_redirect_confirm.html | 12 +----------- 3 files changed, 21 insertions(+), 22 deletions(-) create mode 100644 synapse/res/templates/sso_partial_profile.html diff --git a/synapse/res/templates/sso_new_user_consent.html b/synapse/res/templates/sso_new_user_consent.html index 9fcba8db587b..9a0fa8813a2e 100644 --- a/synapse/res/templates/sso_new_user_consent.html +++ b/synapse/res/templates/sso_new_user_consent.html @@ -18,17 +18,7 @@

Your account is nearly ready

Agree to the terms to create your account.

-
- {% if user_profile.avatar_url %} - - {% endif %} - {% if user_profile.display_name %} -
{{ user_profile.display_name }}
- {% else %} -
{{ user_id.split(":")[1:] }}
- {% endif %} -
{{ user_id }}
-
+ {% include "sso_partial_profile.html" %}