sync superusers mfa and otp toggles

This commit is contained in:
Gani Georgiev
2026-04-19 01:22:42 +03:00
parent 3b49e8489e
commit 3ad737e606
3 changed files with 12 additions and 3 deletions

View File

@@ -13,6 +13,9 @@ export function mfaAccordion(collection) {
return collection.mfa;
},
get isSuperusers() {
return collection.system && collection.name == "_superusers";
},
});
return t.details(
@@ -72,7 +75,13 @@ export function mfaAccordion(collection) {
name: "mfa.enabled",
className: "switch",
checked: () => data.config.enabled,
onchange: (e) => (data.config.enabled = e.target.checked),
onchange: (e) => {
data.config.enabled = e.target.checked;
if (data.isSuperusers) {
collection.otp.enabled = e.target.checked;
}
},
}),
t.label({
htmlFor: uniqueId + ".enabled",