Pavanupadhyay27 commited on
Commit
6524a52
·
1 Parent(s): b184ff0

fix: remove login helper and resolve kiosk mixed content blocker

Browse files
frontend/app/kiosk/page.tsx CHANGED
@@ -110,11 +110,8 @@ export default function KioskPage() {
110
  const base64 = canvas.toDataURL("image/jpeg", 0.82);
111
  setScanning(true);
112
  try {
113
- const host = window.location.hostname;
114
- const port = window.location.port ? `:${window.location.port}` : "";
115
-
116
- // Connect to the backend running at port 8000
117
- const url = `http://${host}:8000/api/v1/kiosk/scan`;
118
  const res = await fetch(url, {
119
  method: "POST",
120
  headers: { "Content-Type": "application/json" },
@@ -146,8 +143,8 @@ export default function KioskPage() {
146
  setMatchTime(new Date().toLocaleTimeString([], { hour: "2-digit", minute: "2-digit", second: "2-digit", hour12: true }));
147
  triggerCooldown(4500);
148
  if (voiceEnabled && data.tts_url) {
149
- const host = window.location.hostname;
150
- new Audio(`http://${host}:8000${data.tts_url}`).play().catch((err) => {
151
  console.error("Autoplay voice greeting failed:", err);
152
  });
153
  }
 
110
  const base64 = canvas.toDataURL("image/jpeg", 0.82);
111
  setScanning(true);
112
  try {
113
+ // Connect to the backend running at the configured URL
114
+ const url = `${getBackendUrl()}/kiosk/scan`;
 
 
 
115
  const res = await fetch(url, {
116
  method: "POST",
117
  headers: { "Content-Type": "application/json" },
 
143
  setMatchTime(new Date().toLocaleTimeString([], { hour: "2-digit", minute: "2-digit", second: "2-digit", hour12: true }));
144
  triggerCooldown(4500);
145
  if (voiceEnabled && data.tts_url) {
146
+ const backendBaseUrl = getBackendUrl().replace("/api/v1", "");
147
+ new Audio(`${backendBaseUrl}${data.tts_url}`).play().catch((err) => {
148
  console.error("Autoplay voice greeting failed:", err);
149
  });
150
  }
frontend/app/page.tsx CHANGED
@@ -201,13 +201,6 @@ export default function LoginPage() {
201
  )}
202
  </button>
203
  </form>
204
-
205
- {/* Default credentials hint */}
206
- <div className="mt-5 pt-5 border-t border-slate-100">
207
- <p className="text-[10px] text-slate-500 text-center font-mono">
208
- Default: admin@netraid.ai / Admin@NetraID2026
209
- </p>
210
- </div>
211
  </div>
212
 
213
  {/* Kiosk link */}
 
201
  )}
202
  </button>
203
  </form>
 
 
 
 
 
 
 
204
  </div>
205
 
206
  {/* Kiosk link */}