mirror of
https://git.anonymousland.org/anonymousland/synapse.git
synced 2025-05-02 21:04:50 -04:00
Social login UI polish (#9301)
This commit is contained in:
parent
ce669863b9
commit
e288499c60
15 changed files with 240 additions and 81 deletions
|
@ -1472,10 +1472,22 @@ class AuthHandler(BaseHandler):
|
|||
# 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,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue