Skip to content

Commit

Permalink
removed check for session in captcha request. sytest 11register.pl do…
Browse files Browse the repository at this point in the history
…esnt provide this and fails
  • Loading branch information
louisgregg committed Dec 14, 2024
1 parent 2701a2a commit 0cb78f8
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 7 deletions.
6 changes: 0 additions & 6 deletions synapse/handlers/ui_auth/checkers.py
Original file line number Diff line number Diff line change
Expand Up @@ -115,12 +115,6 @@ async def check_auth(self, authdict: dict, clientip: str) -> Any:
raise LoginError(
400, "Captcha response is required", errcode=Codes.CAPTCHA_NEEDED
)
try:
_ = authdict["session"]
except KeyError:
# Client tried to provide captcha but didn't give the session ID:
# bad request.
raise LoginError(400, "Missing UIA session", Codes.MISSING_PARAM)

logger.debug("Submitting recaptcha response %s", user_response)

Expand Down
2 changes: 1 addition & 1 deletion tests/handlers/test_checkers.py
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ def test_check_missing_session(self: "TestRecaptchaAuthChecker") -> None:

d = ensureDeferred(self.recaptcha_checker.check_auth(authdict, clientip))
f = self.failureResultOf(d, LoginError)
self.assertEqual(f.value.errcode, Codes.MISSING_PARAM)
self.assertEqual(f.value.errcode, Codes.UNAUTHORIZED)

def test_check_auth_missing_response(self: "TestRecaptchaAuthChecker") -> None:
"""Test that authentication fails when the user captcha response is missing."""
Expand Down

0 comments on commit 0cb78f8

Please sign in to comment.