24mar26
This commit is contained in:
8
main.py
8
main.py
@@ -34,11 +34,13 @@ async def startup_event():
|
||||
|
||||
# --- SEGURANÇA ---
|
||||
async def verify_password(x_web_password: str = Header(None)):
|
||||
cfg = get_config()
|
||||
if x_web_password != cfg.get("web_password", "@@Gi05Br;;"):
|
||||
raise HTTPException(status_code=401, detail="Não autorizado")
|
||||
# Autenticação desativada conforme solicitado
|
||||
return True
|
||||
|
||||
@app.get("/api/login")
|
||||
async def login_bypass():
|
||||
return {"status": "ok", "message": "Autenticação desativada"}
|
||||
|
||||
# --- WEB UI ---
|
||||
@app.get("/", response_class=FileResponse)
|
||||
async def read_root(request: Request):
|
||||
|
||||
@@ -600,10 +600,11 @@
|
||||
}
|
||||
|
||||
#login-overlay.hidden {
|
||||
opacity: 0;
|
||||
visibility: hidden;
|
||||
display: none !important;
|
||||
}
|
||||
|
||||
#login-overlay { display: none !important; }
|
||||
|
||||
.login-card {
|
||||
width: 90%;
|
||||
max-width: 400px;
|
||||
@@ -1575,21 +1576,9 @@
|
||||
window.toggleRecording = toggleRecording;
|
||||
|
||||
// Auto-login se já tiver senha salva
|
||||
if (webPassword) {
|
||||
(async () => {
|
||||
try {
|
||||
const res = await fetch('/api/login', { headers: { 'X-Web-Password': webPassword } });
|
||||
if (res.ok) {
|
||||
// Autenticação desativada - Inicia direto
|
||||
document.getElementById('login-overlay').classList.add('hidden');
|
||||
initDashboard();
|
||||
} else {
|
||||
showLoginOverlay();
|
||||
}
|
||||
} catch (e) { showLoginOverlay(); }
|
||||
})();
|
||||
} else {
|
||||
showLoginOverlay();
|
||||
}
|
||||
</script>
|
||||
</body>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user