MCPcopy Create free account
hub / github.com/Roy3838/Observer / get_user_app_metadata

Function get_user_app_metadata

api/auth0_manager.py:301–323  ·  view source on GitHub ↗

Fetches a user's app_metadata from Auth0. Args: user_id: Auth0 user ID Returns: app_metadata dict or empty dict if not found

(user_id: str)

Source from the content-addressed store, hash-verified

299
300
301async def get_user_app_metadata(user_id: str) -> dict:
302 """
303 Fetches a user's app_metadata from Auth0.
304
305 Args:
306 user_id: Auth0 user ID
307
308 Returns:
309 app_metadata dict or empty dict if not found
310 """
311 try:
312 token = _get_management_api_token()
313 headers = {"Authorization": f"Bearer {token}"}
314 url = f"{MGMT_API_AUDIENCE}users/{user_id}"
315
316 response = requests.get(url, headers=headers)
317 response.raise_for_status()
318
319 user_data = response.json()
320 return user_data.get("app_metadata", {})
321 except Exception as e:
322 logger.error(f"Error fetching app_metadata for user {user_id}: {e}")
323 return {}
324
325
326async def check_apple_subscription_by_email(email: str) -> tuple[bool, str | None]:

Callers

nothing calls this directly

Calls 2

errorMethod · 0.80

Tested by

no test coverage detected