diff --git a/src/Server.py b/src/Server.py index af29ec9..d2a7547 100644 --- a/src/Server.py +++ b/src/Server.py @@ -936,20 +936,20 @@ async def import_signed_license(req: Request): @app.post("/api/license/renew") @app.post("/api/license/sync") -async def trigger_license_renewal(req: Optional[Request] = None): +async def trigger_license_renewal(request: Request): """ Explicitly triggers automated mTLS sync and renewal with logar.eibl.tech. Supports picking up seat quota increases and certificate extensions in-flight. """ requested_seats = None seat_increment = 0 - if req: - try: - body = await req.json() + try: + body = await request.json() + if isinstance(body, dict): requested_seats = body.get("requested_seats") seat_increment = int(body.get("seat_increment", 0)) - except Exception: - pass + except Exception: + pass config = SERVER_STATE.get("config", {}) cert_dir = config.get("cert_dir", "certs")