From f58f5ab7425114a6a50d1093d482a37cd6289f88 Mon Sep 17 00:00:00 2001 From: Dionisio Date: Fri, 13 Feb 2026 22:35:26 +0100 Subject: [PATCH] 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 --- static/profile.html | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/static/profile.html b/static/profile.html index 54f97eaa..37d9af5e 100644 --- a/static/profile.html +++ b/static/profile.html @@ -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) {