Skip to content

Commit 9cc6636

Browse files
committed
feat: add Coldwire protocol support
1 parent c973f99 commit 9cc6636

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

logic/authentication.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,10 +35,13 @@ def authenticate_account(user_data: dict) -> dict:
3535
private_key = user_data["lt_auth_sign_keys"]["private_key"]
3636
public_key_encoded = user_data["lt_auth_sign_keys"]["public_key"]
3737
public_key_encoded = b64encode(public_key_encoded).decode()
38-
user_id = user_data.get("user_id") or ""
38+
user_id = user_data.get("user_id")
3939

4040
try:
41-
response = http_request(url + "/authenticate/init", "POST", metadata = {"public_key": public_key_encoded, "user_id": user_id })
41+
if user_id:
42+
response = http_request(url + "/authenticate/init", "POST", metadata = {"user_id": user_id })
43+
else:
44+
response = http_request(url + "/authenticate/init", "POST", metadata = {"public_key": public_key_encoded })
4245
except Exception:
4346
if user_data["settings"]["proxy_info"] is not None:
4447
raise ValueError("Could not connect to server! Are you sure your proxy settings are valid ?")

0 commit comments

Comments
 (0)