Skip to content

Commit 6941c4f

Browse files
committed
fix login bug
1 parent 06dae96 commit 6941c4f

1 file changed

Lines changed: 11 additions & 2 deletions

File tree

ibw/client.py

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -243,10 +243,19 @@ def connect(self, start_server: bool = True) -> bool:
243243
auth_response = self.is_authenticated()
244244

245245
if 'statusCode' in auth_response.keys() and auth_response['statusCode'] == 401:
246-
self.reauthenticate()
247-
self.authenticated = False
246+
print("Session isn't connected, closing script.")
247+
self.close_session()
248+
248249
elif 'authenticated' in auth_response.keys() and auth_response['authenticated'] == True:
249250
self.authenticated = True
251+
252+
elif 'authenticated' in auth_response.keys() and auth_response['authenticated'] == False:
253+
254+
if self.reauthenticate().get('message','Null') == 'triggered':
255+
self.authenticated = True
256+
else:
257+
self.authenticated = False
258+
250259
elif auth_response.get('authenticated','Null') in (False, 'Null') and auth_response.get('connected','Null') in (False, 'Null'):
251260

252261
self.validate()

0 commit comments

Comments
 (0)