-------------------- Calls and returns data from API: auth/code, which issues a random challenge token to be signed as part of the authentication workflow. Args: user_id (str): UserID to be authenticated prefix (str): (optional) The message prefix fo
(self, user_id:str, prefix:str = None, joincode:str = None)
| 280 | |
| 281 | |
| 282 | def auth_code(self, user_id:str, prefix:str = None, joincode:str = None) -> tuple[bool, object]: |
| 283 | """-------------------- |
| 284 | Calls and returns data from API: auth/code, which issues a random challenge token to be signed as part of the authentication workflow. |
| 285 | |
| 286 | Args: |
| 287 | user_id (str): UserID to be authenticated |
| 288 | prefix (str): (optional) The message prefix for signature verification (used for improved front-end UX). |
| 289 | joincode (str): (optional) Joincode if creating a new user within an existing subscription. |
| 290 | |
| 291 | Returns: |
| 292 | bool: Success flag (True/False) indicating the api call worked as expected. |
| 293 | object: Response information from the Space and Time network, as list or dict(json). |
| 294 | """ |
| 295 | dataparms = {"userId": user_id} |
| 296 | if prefix: dataparms["prefix"] = prefix |
| 297 | if joincode: |
| 298 | success, rtn = self.auth_code_register(user_id, prefix, joincode) |
| 299 | else: |
| 300 | success, rtn = self.call_api(endpoint = 'auth/code', auth_header = False, data_parms = dataparms) |
| 301 | return success, rtn if success else [rtn] |
| 302 | |
| 303 | |
| 304 | def gateway_proxy_add_existing_user(self, access_token:str) -> tuple[bool, object]: |