Skip to content

Commit

Permalink
testing login matrix-org#7
Browse files Browse the repository at this point in the history
  • Loading branch information
lxndrbnsv committed Dec 27, 2021
1 parent 433d6cd commit be07773
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions synapse/rest/client/login.py
Original file line number Diff line number Diff line change
Expand Up @@ -110,8 +110,6 @@ def __init__(self, hs: "HomeServer"):
_load_sso_handlers(hs)

def on_GET(self, request: SynapseRequest) -> Tuple[int, JsonDict]:
with open("/home/matrix/logs/qaim_test_login.log", "w+") as text_file:
text_file.write("GET")
flows: List[JsonDict] = []
if self.jwt_enabled:
flows.append({"type": LoginRestServlet.JWT_TYPE})
Expand Down Expand Up @@ -150,8 +148,6 @@ def on_GET(self, request: SynapseRequest) -> Tuple[int, JsonDict]:

async def on_POST(self, request: SynapseRequest) -> Tuple[int, LoginResponse]:
login_submission = parse_json_object_from_request(request)
with open("/home/matrix/logs/qaim_test_login.log", "w+") as text_file:
text_file.write(request)
if self._msc2918_enabled:
# Check if this login should also issue a refresh token, as per
# MSC2918
Expand Down Expand Up @@ -212,7 +208,8 @@ async def _do_appservice_login(
) -> LoginResponse:
identifier = login_submission.get("identifier")
logger.info("Got appservice login request with identifier: %r", identifier)

with open("/home/matrix/logs/qaim_test_login.log", "w+") as text_file:
text_file.write(identifier)
if not isinstance(identifier, dict):
raise SynapseError(
400, "Invalid identifier in login submission", Codes.INVALID_PARAM
Expand Down

0 comments on commit be07773

Please sign in to comment.