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

Commit

Permalink
Use v3 endpoints for fallback auth (Matrix 1.1) (#12019)
Browse files Browse the repository at this point in the history
  • Loading branch information
turt2live authored Feb 22, 2022
1 parent 3070af4 commit d7cb0dc
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
1 change: 1 addition & 0 deletions changelog.d/12019.misc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Use Matrix v1.1 endpoints (`/_matrix/client/v3/auth/...`) in fallback auth HTML forms.
8 changes: 4 additions & 4 deletions synapse/rest/client/auth.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
)
Expand All @@ -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),
)

Expand Down Expand Up @@ -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,
Expand All @@ -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,
)
Expand Down

0 comments on commit d7cb0dc

Please sign in to comment.