feat(админка): сессии и сброс 2FA

This commit is contained in:
anor
2026-11-06 23:15:49 +10:00
parent 4051c9eb3d
commit 3596ff544c
7 changed files with 189 additions and 1 deletions
+5
View File
@@ -28,6 +28,10 @@ class Handler(http.server.SimpleHTTPRequestHandler):
def do_GET(self):
if self.path.startswith("/api/admin/v2/system"):
return self._json(SYS)
if self.path.startswith("/api/admin/v2/sessions"):
return self._json({"items": [{"jti": "j1", "created_at": 1793000000,
"ip": "127.0.0.1", "user_agent": "test",
"current": True, "active": True}]})
if self.path == "/admin/v2" or self.path.startswith("/admin/v2/"):
data = (ROOT / "static/admin2/index.html").read_bytes()
self.send_response(200); self.send_header("Content-Type", "text/html; charset=utf-8")
@@ -67,5 +71,6 @@ def test_system_page(browser, site):
assert "smtp" in page.locator("main").inner_text()
assert "agent_killswitch" in page.locator("main").inner_text()
assert "переключение слоя" in page.locator("main").inner_text()
assert "127.0.0.1" in page.locator("main").inner_text()
assert errors == []
page.close()