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:
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user