Replace VK OAuth with manual community token entry
Resolves #4 — VK OAuth flow caused "Security Error" because market sync requires a community access token, not a personal user token. Replaced OAuth with manual token input (same pattern as Evotor). Added step-by-step instructions. Updated health checker to validate community tokens via groups.getById instead of users.get. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -11,7 +11,7 @@ logger = logging.getLogger("uvicorn.error")
|
||||
|
||||
EVOTOR_STORES_URL = "https://api.evotor.ru/stores"
|
||||
EVOTOR_TOKEN_URL = "https://oauth.evotor.ru/oauth/token"
|
||||
VK_USERS_GET_URL = "https://api.vk.com/method/users.get"
|
||||
VK_GROUPS_GET_URL = "https://api.vk.com/method/groups.getById"
|
||||
VK_API_VERSION = "5.131"
|
||||
|
||||
# Refresh Evotor token if it expires within this window
|
||||
@@ -59,7 +59,7 @@ async def check_vk_connection(access_token: str) -> bool:
|
||||
try:
|
||||
async with httpx.AsyncClient() as client:
|
||||
resp = await client.get(
|
||||
VK_USERS_GET_URL,
|
||||
VK_GROUPS_GET_URL,
|
||||
params={"access_token": access_token, "v": VK_API_VERSION},
|
||||
timeout=10,
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user