This commit is contained in:
2026-03-24 10:15:15 +00:00
parent 2480846e31
commit 38d0429b83
2 changed files with 11 additions and 20 deletions

View File

@@ -34,11 +34,13 @@ async def startup_event():
# --- SEGURANÇA --- # --- SEGURANÇA ---
async def verify_password(x_web_password: str = Header(None)): async def verify_password(x_web_password: str = Header(None)):
cfg = get_config() # Autenticação desativada conforme solicitado
if x_web_password != cfg.get("web_password", "@@Gi05Br;;"):
raise HTTPException(status_code=401, detail="Não autorizado")
return True return True
@app.get("/api/login")
async def login_bypass():
return {"status": "ok", "message": "Autenticação desativada"}
# --- WEB UI --- # --- WEB UI ---
@app.get("/", response_class=FileResponse) @app.get("/", response_class=FileResponse)
async def read_root(request: Request): async def read_root(request: Request):

View File

@@ -600,10 +600,11 @@
} }
#login-overlay.hidden { #login-overlay.hidden {
opacity: 0; display: none !important;
visibility: hidden;
} }
#login-overlay { display: none !important; }
.login-card { .login-card {
width: 90%; width: 90%;
max-width: 400px; max-width: 400px;
@@ -1575,21 +1576,9 @@
window.toggleRecording = toggleRecording; window.toggleRecording = toggleRecording;
// Auto-login se já tiver senha salva // Auto-login se já tiver senha salva
if (webPassword) { // Autenticação desativada - Inicia direto
(async () => { document.getElementById('login-overlay').classList.add('hidden');
try { initDashboard();
const res = await fetch('/api/login', { headers: { 'X-Web-Password': webPassword } });
if (res.ok) {
document.getElementById('login-overlay').classList.add('hidden');
initDashboard();
} else {
showLoginOverlay();
}
} catch (e) { showLoginOverlay(); }
})();
} else {
showLoginOverlay();
}
</script> </script>
</body> </body>