소스 검색

Validate user table input and handle invalid values

Erwin Jacimino 5 달 전
부모
커밋
0df35e18e6
1개의 변경된 파일6개의 추가작업 그리고 0개의 파일을 삭제
  1. 6 0
      public/main/js/app.js

+ 6 - 0
public/main/js/app.js

@@ -99,6 +99,12 @@ async function initializeApp() {
         return; 
     }
     userTable = parseInt(urlTable);
+    if (userTable < 0 || userTable > 1000) {
+        alert("Mesa no válida.");
+        console.warn("Mesa no válida.");
+        window.location.replace("/");
+        return;
+    }
 
     // 2. Verificar Cache
     const isCacheValid = await checkCache();