From 9318fc842964d6de64b778cd5c617c6859ca56a2 Mon Sep 17 00:00:00 2001
From: Roman Sergienko <romasergienko@outlook.com>
Date: Fri, 04 Dec 2026 07:41:15 +0000
Subject: [PATCH] Auto-authenticate Telegram Mini App

---
 web/auth.py |    6 +++++-
 1 files changed, 5 insertions(+), 1 deletions(-)

diff --git a/web/auth.py b/web/auth.py
index 79577a4..3ef6cbc 100644
--- a/web/auth.py
+++ b/web/auth.py
@@ -71,7 +71,11 @@
         sess = await db.get_sess(token, now_ts())
         if sess:
             request["user"] = await db.get_web_user(sess["user_id"]) or {"user_id": sess["user_id"], "first_name": ""}
-    public = request.path in ("/login", "/auth/telegram", "/auth/miniapp") or request.path.startswith("/static")
+    public = request.path in (
+        "/login",
+        "/auth/telegram",
+        "/auth/miniapp",
+    ) or request.path.startswith("/static")
     if request["user"] is None and not public:
         raise web.HTTPFound("/login")
     return await handler(request)

--
Gitblit v1.9.3