fix refresh token
This commit is contained in:
7
main.py
7
main.py
@ -11,6 +11,7 @@ from app.services.promo import PromoService
|
||||
from app.webhooks import telegram
|
||||
from app.db.database import users_collection
|
||||
from app.api import marketplace_ws
|
||||
from app.db.database import users_collection, sessions_collection
|
||||
|
||||
|
||||
###################### БОТ ######################
|
||||
@ -23,6 +24,12 @@ WEBHOOK_SECRET = os.getenv("TELEGRAM_WEBHOOK_SECRET", "")
|
||||
async def lifespan(app: FastAPI):
|
||||
# ===== STARTUP =====
|
||||
|
||||
# TTL для сессий (автоочистка)
|
||||
await sessions_collection.create_index(
|
||||
"expires_at",
|
||||
expireAfterSeconds=0
|
||||
)
|
||||
|
||||
await users_collection.create_index("expires_at", expireAfterSeconds=0)
|
||||
await users_collection.create_index("telegram_user_id", unique=True, sparse=True)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user