File tree Expand file tree Collapse file tree 2 files changed +17
-1
lines changed
Expand file tree Collapse file tree 2 files changed +17
-1
lines changed Original file line number Diff line number Diff line change @@ -98,4 +98,7 @@ jules.lasne@gmail.com
9898- [ ] Migrate tests to pytest-recording
9999- [ ] Add a readthedocs documentation
100100- [ ] Switch to an OpenAPI generated client ? see https://github.com/shellhub-io/shellhub/issues/3497#issuecomment-1917478654
101- - [ ] Add deployment to pypi on merge to main
101+ - [ ] Add deployment to pypi on merge to main
102+ - [ ] Add a changelog
103+ - [ ] Setup coverage reporting
104+ - [ ] Update tests to tests on multiple python versions
Original file line number Diff line number Diff line change @@ -68,6 +68,19 @@ def make_request(
6868 },
6969 json = json ,
7070 )
71+
72+ if response .status_code == 401 :
73+ self ._login ()
74+ response = getattr (requests , method .lower ())(
75+ f"{ self ._endpoint } { endpoint } { params if params else '' } " ,
76+ headers = {
77+ "Authorization" : f"Bearer { self ._access_token } " ,
78+ },
79+ json = json ,
80+ )
81+ if response .status_code == 401 :
82+ raise ShellHubApiError ("Couldn't fix request with a token refresh" )
83+
7184 return response
7285
7386 def _get_devices (
You can’t perform that action at this time.
0 commit comments