Бот для капчи в чатах
Roman Sergienko
12 hours ago 9318fc842964d6de64b778cd5c617c6859ca56a2
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)