Skip to content

Commit

Permalink
Remove basic auth if token is available
Browse files Browse the repository at this point in the history
  • Loading branch information
LLipter committed Dec 6, 2024
1 parent a3b4d67 commit 4f3e384
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions python/mujinwebstackclient/controllerwebclientraw.py
Original file line number Diff line number Diff line change
Expand Up @@ -259,8 +259,8 @@ def CallGraphAPI(self, query, variables=None, headers=None, timeout=5.0):

def UpdateJsonWebToken(self, jsonWebToken):
if jsonWebToken == '':
self._session.auth = None
self._headers['Authorization'] = 'Bearer ' + jsonWebToken
else:
self._session.auth = requests_auth.HTTPBasicAuth(self._username, self._password)
self._headers.pop('Authorization', None)
else:
self._session.auth = None
self._headers['Authorization'] = 'Bearer ' + jsonWebToken

0 comments on commit 4f3e384

Please sign in to comment.