diff --git a/utils/accounts_client.py b/utils/accounts_client.py index 1143d0b..ad59f03 100644 --- a/utils/accounts_client.py +++ b/utils/accounts_client.py @@ -10,9 +10,6 @@ from gooyal_accounts_client.api.users import users_api_users_retrieve from gooyal_accounts_client.api.oauth2 import oauth2_apis_applications_retrieve from gooyal_accounts_client.types import Response -from authlib.integrations.django_client import OAuth - - def login_as_client_credentials(): access_token = cache.get('wallet_access_token') @@ -40,7 +37,7 @@ def login_as_client_credentials(): auth_data = response.json() if 'access_token' in auth_data: auth_data['created_at'] = time.time() - cache.set('wallet_access_token', auth_data) + cache.set('wallet_access_token', auth_data, timeout=auth_data.get('expires_in')-5) return auth_data @@ -56,4 +53,10 @@ def get_user_details(uuid): # or if you need more info (e.g. status_code) # response: Response[MyDataModel] = get_my_data_model.sync_detailed(client=client) - return data \ No newline at end of file + return data + +def get_application_details(uuid): + data: Application = oauth2_apis_applications_retrieve.sync(client=client, id=uuid) + print(data) + + return data