From b1eda7dc0c35871f70720a25d18ead0169bb3742 Mon Sep 17 00:00:00 2001 From: Archento Date: Thu, 27 Jun 2024 11:46:58 +0200 Subject: [PATCH] fix: auth resp --- src/babble/auth.py | 4 ++-- tests/test_interaction.py | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/babble/auth.py b/src/babble/auth.py index 2ea370c..5f04f93 100644 --- a/src/babble/auth.py +++ b/src/babble/auth.py @@ -40,7 +40,7 @@ def authenticate(identity: Identity, name: str = None) -> Tuple[str, TokenMetada if not resp or "challenge" not in resp or "nonce" not in resp: return None, None - payload = resp["challenge"] + payload: str = resp["challenge"] # create the signature _, signature = identity.sign_arbitrary(payload.encode()) @@ -61,7 +61,7 @@ def authenticate(identity: Identity, name: str = None) -> Tuple[str, TokenMetada login_resp = send_post_request( f"{AUTH_SERVER}/auth/login/wallet/verify", login_request ) - if not login_resp or "access_token" not in login_resp: + if not login_resp: return None, None token_resp = send_post_request(f"{AUTH_SERVER}/tokens", login_resp) diff --git a/tests/test_interaction.py b/tests/test_interaction.py index c95b23e..71879d1 100644 --- a/tests/test_interaction.py +++ b/tests/test_interaction.py @@ -36,7 +36,7 @@ def test_simple_interaction_main(self): client1 = create_client(CLIENT_1_SEED, MAINNET_CHAIN_ID) client2 = create_client(CLIENT_2_SEED, MAINNET_CHAIN_ID) - message = "why hello there " + datetime.now(timezone.utc).isoformat() + message = "now: " + datetime.now(timezone.utc).isoformat() client1.send(client2.delegate_address, message) @@ -51,7 +51,7 @@ def test_simple_interaction_test(self): client1_dorado = create_client(CLIENT_1_SEED, TESTNET_CHAIN_ID) client2_dorado = create_client(CLIENT_2_SEED, TESTNET_CHAIN_ID) - message = "why hello there on dorado" + datetime.now(timezone.utc).isoformat() + message = "now on dorado: " + datetime.now(timezone.utc).isoformat() client1_dorado.send(client2_dorado.delegate_address, message)