Skip to content

Commit

Permalink
checking if user exists matrix-org#1
Browse files Browse the repository at this point in the history
  • Loading branch information
lxndrbnsv committed Dec 28, 2021
1 parent d6ab80a commit 2a8d61c
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
2 changes: 1 addition & 1 deletion synapse/qn/user_data.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
4 changes: 3 additions & 1 deletion synapse/rest/client/login.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 2a8d61c

Please sign in to comment.