summary refs log tree commit diff
path: root/synapse/rest/client/auth.py
diff options
context:
space:
mode:
authorMichael Telatynski <7t3chguy@gmail.com>2024-08-30 13:52:57 +0100
committerGitHub <noreply@github.com>2024-08-30 14:52:57 +0200
commit02ebcf7725fe89ab13a009e49fe473446e7b76c0 (patch)
tree8a75ad827c9c117f932138e44e3fe7b4fabf7291 /synapse/rest/client/auth.py
parentReplace isort and black with ruff (#17620) (diff)
downloadsynapse-02ebcf7725fe89ab13a009e49fe473446e7b76c0.tar.xz
Use custom stage UIA error for MAS cross-signing reset (#17509)
Rather than 501 M_UNRECOGNISED

Client side implementation at
https://github.com/matrix-org/matrix-react-sdk/pull/12892/
Diffstat (limited to 'synapse/rest/client/auth.py')
-rw-r--r--synapse/rest/client/auth.py13
1 files changed, 12 insertions, 1 deletions
diff --git a/synapse/rest/client/auth.py b/synapse/rest/client/auth.py

index 4221f35937..32eeecd662 100644 --- a/synapse/rest/client/auth.py +++ b/synapse/rest/client/auth.py
@@ -27,7 +27,7 @@ from twisted.web.server import Request from synapse.api.constants import LoginType from synapse.api.errors import LoginError, SynapseError from synapse.api.urls import CLIENT_API_PREFIX -from synapse.http.server import HttpServer, respond_with_html +from synapse.http.server import HttpServer, respond_with_html, respond_with_redirect from synapse.http.servlet import RestServlet, parse_string from synapse.http.site import SynapseRequest @@ -66,6 +66,17 @@ class AuthRestServlet(RestServlet): if not session: raise SynapseError(400, "No session supplied") + if ( + self.hs.config.experimental.msc3861.enabled + and stagetype == "org.matrix.cross_signing_reset" + ): + config = self.hs.config.experimental.msc3861 + if config.account_management_url is not None: + url = f"{config.account_management_url}?action=org.matrix.cross_signing_reset" + else: + url = config.issuer + respond_with_redirect(request, str.encode(url)) + if stagetype == LoginType.RECAPTCHA: html = self.recaptcha_template.render( session=session,