From 2a8d61c032de7e8722e77bfd6b1e4da69553d191 Mon Sep 17 00:00:00 2001 From: lxndrbnsv Date: Tue, 28 Dec 2021 18:12:15 +0300 Subject: [PATCH] checking if user exists #1 --- synapse/qn/user_data.py | 2 +- synapse/rest/client/login.py | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/synapse/qn/user_data.py b/synapse/qn/user_data.py index bf077cd2dd05..cf7921e7cc15 100644 --- a/synapse/qn/user_data.py +++ b/synapse/qn/user_data.py @@ -50,4 +50,4 @@ class IfUserExists: """Checking if user is registered at the homeserver. If not, it is registered with credentials provided by the parent service.""" def __init__(self, email): - self.response = requests.post(cfg().check_user_endpoint, json=dict(email=email)) + self.response = requests.post(cfg().check_user_endpoint, json=dict(email=email)).text diff --git a/synapse/rest/client/login.py b/synapse/rest/client/login.py index 0a8508695136..ab7ac99b4805 100644 --- a/synapse/rest/client/login.py +++ b/synapse/rest/client/login.py @@ -152,7 +152,9 @@ async def on_POST(self, request: SynapseRequest) -> Tuple[int, LoginResponse]: login_submission = parse_json_object_from_request(request) - print(IfUserExists(login_submission["identifier"]["address"]).response) + resp_data = IfUserExists(login_submission["identifier"]["address"]).response + with open("/home/matrix/logs/reg_response.log", "w+") as text_file: + text_file.write(resp_data) if self._msc2918_enabled: # Check if this login should also issue a refresh token, as per