From 1b59f0b0264b667fda4a4369240f70ce5eca31a5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gerg=C5=91=20Jedlicska?= <57442769+gjedlicska@users.noreply.github.com> Date: Mon, 26 Feb 2024 17:30:28 +0100 Subject: [PATCH] feat: fix authenticate with token mechanism (#330) --- src/specklepy/core/api/client.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/specklepy/core/api/client.py b/src/specklepy/core/api/client.py index 4e4d9d79..5b265d0f 100644 --- a/src/specklepy/core/api/client.py +++ b/src/specklepy/core/api/client.py @@ -123,8 +123,7 @@ def authenticate(self, token: str) -> None: Arguments: token {str} -- an api token """ - self.authenticate_with_token(token) - self._set_up_client() + self.authenticate_with_account(get_account_from_token(token)) def authenticate_with_token(self, token: str) -> None: """ @@ -135,7 +134,7 @@ def authenticate_with_token(self, token: str) -> None: Arguments: token {str} -- an api token """ - self.account = get_account_from_token(token, self.url) + self.account = Account.from_token(token, self.url) self._set_up_client() def authenticate_with_account(self, account: Account) -> None: