accounts client

This commit is contained in:
Sayyid Hamid Mahdavi 2025-03-13 10:06:11 +03:30
parent 50f57875e0
commit 4f8c409637

View file

@ -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
return data
def get_application_details(uuid):
data: Application = oauth2_apis_applications_retrieve.sync(client=client, id=uuid)
print(data)
return data