mirror of
https://github.com/wasrusgen/zov-tech.git
synced 2026-06-03 17:04:48 +00:00
debug: add entry+auth prints
This commit is contained in:
parent
a0c02110d4
commit
d293ded525
@ -421,9 +421,12 @@ def api_catalog_preview_ai(cats: str = "fridge", tiers: str = ""):
|
||||
# =================================================================
|
||||
|
||||
def _handle_me(body: dict[str, Any]) -> dict[str, Any]:
|
||||
import sys
|
||||
print(f"[ME] entry: body keys={list(body.keys())} role_in_body={body.get('role')!r}", flush=True, file=sys.stderr)
|
||||
cfg = get_config()
|
||||
init_data = body.get("initData") or ""
|
||||
auth = verify_init_data(init_data, cfg.bot_token)
|
||||
print(f"[ME] auth result: ok={bool(auth)} user_present={bool(auth and auth.get('user'))}", flush=True, file=sys.stderr)
|
||||
if not auth or not auth.get("user"):
|
||||
return {"error": "invalid_init_data"}
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user