From 7c1c442363e938e80b52e6544c54b8a940995f92 Mon Sep 17 00:00:00 2001 From: KaseToatz1337 Date: Fri, 26 Apr 2024 14:22:46 +0200 Subject: [PATCH] more fix --- app.py | 2 +- html/assets/script.js | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/app.py b/app.py index 4aec0fd..67d4726 100644 --- a/app.py +++ b/app.py @@ -107,7 +107,7 @@ async def flood(pin: int = Form(0), naming: str = Form(""), name: str = Form("") async with session.get(f"https://play.kahoot.it/reserve/session/{pin}/?{int(time.time() * 1000)}") as response: if "x-kahoot-session-token" not in response.headers: return JSONResponse({"message": "Invalid PIN specified.", "type": "error"}, 400) - if len(name) < 2 or len(name) > 15: + if len(name) < 2 or len(name) > 15 and naming != "random": return JSONResponse({"message": "Invalid name specified.", "type": "error"}, 400) if amount < 1 or amount > 2000: return JSONResponse({"message": "Invalid amount specified.", "type": "error"}, 400) diff --git a/html/assets/script.js b/html/assets/script.js index 4e0aee8..c71f4b7 100644 --- a/html/assets/script.js +++ b/html/assets/script.js @@ -52,8 +52,8 @@ window.onload = () => { body: formData }) response = await request.json(); - text.innerText = response.message; - if (response.type == "error") + text.innerText = response["message"]; + if (response["type"] == "error") { text.style.color = "red"; }