From 282ff18155f594e01ec272c5993d631338b4cb94 Mon Sep 17 00:00:00 2001 From: ScriptSorcerer20 Date: Thu, 17 Apr 2025 14:00:07 +0200 Subject: [PATCH] made logout and lowercase unsensetive login and minor fix --- gambling.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/gambling.js b/gambling.js index 3c6a661..f14e171 100644 --- a/gambling.js +++ b/gambling.js @@ -65,7 +65,7 @@ app.post("/register", (request, response) => { let { username, password } = request.body; username = username.toLowerCase(); - if (!username && !password) + if (!username || !password) return response.status(400).json({ error: "Username and password are required" }); const users = get_data(); @@ -85,7 +85,7 @@ app.get("/login", (request, response) => { app.post("/login", (request, response) => { let { username, password } = request.body; username = username.toLowerCase(); - if (!username && !password) + if (!username || !password) return response.status(400).json({ error: "Username and password are required" }); const users = get_data();