code: keep pam enabled and gate oidc

This commit is contained in:
2025-12-28 13:49:30 +01:00
parent 97ea7070cc
commit e380288755
4 changed files with 41 additions and 17 deletions

View File

@ -18,11 +18,11 @@
</header>
<section>
<h3>Login (nur Root-User)</h3>
<h3>Login</h3>
<p>Bevorzugt OIDC nutzen, falls konfiguriert. Die Anmeldung öffnet den Identity Provider und setzt eine Session-Cookie.</p>
<button id="oidcLogin" type="button">Login via OIDC</button>
<hr />
<p>Lokale Anmeldung (PAM) nur falls OIDC nicht verfügbar:</p>
<p>Lokale Anmeldung (PAM) ist immer moeglich:</p>
<form id="loginForm">
<div class="grid">
<div>
@ -84,7 +84,7 @@
<div id="result" class="log"></div>
</section>
<script>
<script>
const statusDiv = document.getElementById('status');
const resultDiv = document.getElementById('result');
const loginStatus = document.getElementById('loginStatus');
@ -136,6 +136,20 @@
}
}
async function checkOidcStatus() {
const button = document.getElementById('oidcLogin');
try {
const data = await api('/login/oidc/status');
if (!data.enabled) {
button.disabled = true;
button.title = 'OIDC nicht konfiguriert';
}
} catch (err) {
button.disabled = true;
button.title = 'OIDC-Status nicht erreichbar';
}
}
async function refreshUsers() {
statusDiv.textContent = 'Lade...';
try {
@ -206,6 +220,7 @@
});
checkSession();
checkOidcStatus();
</script>
</body>
</html>