fix(ui): hide password change form when password login is disabled

The profile page checked user.auth_provider to hide the password
form, but the backend doesn't return that field. Now also queries
/api/auth/oidc/providers and hides the password section when
password_login_enabled is false.

Fixes #96
This commit is contained in:
Dionisio
2026-02-13 22:35:26 +01:00
parent 5771d82b21
commit f58f5ab742
+13
View File
@@ -304,6 +304,19 @@ async function init() {
document.getElementById('password-section').style.display = 'none';
}
// Also check OIDC config: hide password form when password login is disabled
try {
const oidcResp = await fetch(API + '/auth/oidc/providers');
if (oidcResp.ok) {
const oidcInfo = await oidcResp.json();
if (!oidcInfo.password_login_enabled) {
document.getElementById('password-section').style.display = 'none';
}
}
} catch (oidcErr) {
// Ignore — if OIDC endpoint is unavailable, password login is implicitly enabled
}
document.getElementById('loading').style.display = 'none';
document.getElementById('main-content').style.display = 'block';
} catch (e) {