From 046abd4c68a1a9c7ec3a79ca2d038657c9f97dff Mon Sep 17 00:00:00 2001 From: Travis Ralston Date: Thu, 17 Feb 2022 12:56:42 -0700 Subject: [PATCH 1/2] Use v3 endpoints for fallback auth (Matrix 1.1) --- synapse/rest/client/auth.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/synapse/rest/client/auth.py b/synapse/rest/client/auth.py index 9c15a04338b1..e0b2b80e5b9b 100644 --- a/synapse/rest/client/auth.py +++ b/synapse/rest/client/auth.py @@ -62,7 +62,7 @@ async def on_GET(self, request: SynapseRequest, stagetype: str) -> None: if stagetype == LoginType.RECAPTCHA: html = self.recaptcha_template.render( session=session, - myurl="%s/r0/auth/%s/fallback/web" + myurl="%s/v3/auth/%s/fallback/web" % (CLIENT_API_PREFIX, LoginType.RECAPTCHA), sitekey=self.hs.config.captcha.recaptcha_public_key, ) @@ -74,7 +74,7 @@ async def on_GET(self, request: SynapseRequest, stagetype: str) -> None: self.hs.config.server.public_baseurl, self.hs.config.consent.user_consent_version, ), - myurl="%s/r0/auth/%s/fallback/web" + myurl="%s/v3/auth/%s/fallback/web" % (CLIENT_API_PREFIX, LoginType.TERMS), ) @@ -118,7 +118,7 @@ async def on_POST(self, request: Request, stagetype: str) -> None: # Authentication failed, let user try again html = self.recaptcha_template.render( session=session, - myurl="%s/r0/auth/%s/fallback/web" + myurl="%s/v3/auth/%s/fallback/web" % (CLIENT_API_PREFIX, LoginType.RECAPTCHA), sitekey=self.hs.config.captcha.recaptcha_public_key, error=e.msg, @@ -143,7 +143,7 @@ async def on_POST(self, request: Request, stagetype: str) -> None: self.hs.config.server.public_baseurl, self.hs.config.consent.user_consent_version, ), - myurl="%s/r0/auth/%s/fallback/web" + myurl="%s/v3/auth/%s/fallback/web" % (CLIENT_API_PREFIX, LoginType.TERMS), error=e.msg, ) From 38d519316d15cdb21df9efa0d5dca1c3a890c652 Mon Sep 17 00:00:00 2001 From: Travis Ralston Date: Thu, 17 Feb 2022 13:12:43 -0700 Subject: [PATCH 2/2] changelog --- changelog.d/12019.misc | 1 + 1 file changed, 1 insertion(+) create mode 100644 changelog.d/12019.misc diff --git a/changelog.d/12019.misc b/changelog.d/12019.misc new file mode 100644 index 000000000000..b2186320ead4 --- /dev/null +++ b/changelog.d/12019.misc @@ -0,0 +1 @@ +Use Matrix v1.1 endpoints (`/_matrix/client/v3/auth/...`) in fallback auth HTML forms. \ No newline at end of file