-------------------- Calls and returns data from API: auth/refresh, which accepts a Refresh_Token and provides a new Access_Token and Refresh_Token. Returns: bool: Success flag (True/False) indicating the api call worked as expected. object: R
(self, refresh_token:str)
| 476 | |
| 477 | |
| 478 | def token_refresh(self, refresh_token:str): |
| 479 | """-------------------- |
| 480 | Calls and returns data from API: auth/refresh, which accepts a Refresh_Token and provides a new Access_Token and Refresh_Token. |
| 481 | |
| 482 | Returns: |
| 483 | bool: Success flag (True/False) indicating the api call worked as expected. |
| 484 | object: Response information from the Space and Time network, as list or dict(json). |
| 485 | """ |
| 486 | headers = { 'authorization': f'Bearer {refresh_token}' } |
| 487 | success, rtn = self.call_api('auth/refresh', False, header_parms=headers) |
| 488 | if success: |
| 489 | self.__settokens__(rtn['accessToken'], rtn['accessTokenExpires'], rtn['refreshToken'], rtn['refreshTokenExpires']) |
| 490 | return success, rtn if success else [rtn] |
| 491 | |
| 492 | |
| 493 | def auth_logout(self): |
no test coverage detected