Skip to content

Commit

Permalink
Use fixed device_ids for login
Browse files Browse the repository at this point in the history
This will cut down on throwaway devices being generated.
  • Loading branch information
ulope committed Sep 7, 2020
1 parent 7778c5d commit a5e7063
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
4 changes: 3 additions & 1 deletion build/purger/purger.py
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,9 @@ def purge(

api = GMatrixHttpApi(server)
try:
response = api.login("m.login.password", user=username, password=password)
response = api.login(
"m.login.password", user=username, password=password, device_id="purger"
)
api.token = response["access_token"]
except (MatrixError, KeyError) as ex:
click.secho(f"Could not log in to server {server}: {ex}")
Expand Down
4 changes: 3 additions & 1 deletion build/room_ensurer/room_ensurer.py
Original file line number Diff line number Diff line change
Expand Up @@ -338,7 +338,9 @@ def _connect(self, server_name: str, server_url: str) -> Tuple[str, GMatrixHttpA
username = str(to_normalized_address(signer.address))
password = encode_hex(signer.sign(server_name.encode()))

response = api.login("m.login.password", user=username, password=password)
response = api.login(
"m.login.password", user=username, password=password, device_id="room_ensurer"
)
api.token = response["access_token"]
log.debug("Connected", server=server_name)
return server_name, api
Expand Down

0 comments on commit a5e7063

Please sign in to comment.