big update new dashboard and import export
This commit is contained in:
@@ -50,6 +50,18 @@ async def login(username: str, password: str) -> tuple[str | None, str | None]:
|
||||
return None, f"Ошибка: {e}"
|
||||
|
||||
|
||||
async def logout(token: str) -> None:
|
||||
"""POST /auth/logout — инвалидирует токен на сервере (Redis блэклист)."""
|
||||
try:
|
||||
async with httpx.AsyncClient(base_url=API_URL, timeout=_TIMEOUT) as client:
|
||||
await client.post(
|
||||
"/auth/logout",
|
||||
headers={"Authorization": f"Bearer {token}"},
|
||||
)
|
||||
except Exception:
|
||||
pass # даже если сервер недоступен — локальный logout всё равно произойдёт
|
||||
|
||||
|
||||
async def get_me(token: str) -> dict | None:
|
||||
"""GET /users/me — данные текущего пользователя."""
|
||||
try:
|
||||
|
||||
Reference in New Issue
Block a user