Skip to content

Commit daafa06

Browse files
committed
Mod remove domain param if None
1 parent c768fd3 commit daafa06

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

core_client/__init__.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -51,8 +51,9 @@ def __init__(
5151
self.timeout = timeout
5252

5353
def _basic_login(self):
54+
domain_param = '?domain={self.domain}' if self.domain else ''
5455
r_login = httpx.post(
55-
url=f"{self.base_url}/api/login?domain={self.domain}",
56+
url=f"{self.base_url}/api/login{domain_param}",
5657
json={
5758
"username": f"{self.username}",
5859
"password": f"{self.password}",
@@ -160,9 +161,8 @@ def _refresh_access_token(self):
160161

161162
def _get_headers(self):
162163
_headers = self.headers
163-
if (
164-
self.username and self.password
165-
) or self.access_token or self.refresh_token or self.auth0_token:
164+
if (self.username and self.password) or \
165+
self.access_token or self.refresh_token or self.auth0_token:
166166
if (
167167
self.refresh_token
168168
and self._refresh_token_is_expired() is False

0 commit comments

Comments
 (0)