()
| 9698 | } |
| 9699 | |
| 9700 | function handleSave() { |
| 9701 | const enableFormLogin = !!document.getElementById("enableFormLogin")?.checked; |
| 9702 | const enableBasicAuth = !!document.getElementById("enableBasicAuth")?.checked; |
| 9703 | const enableOIDCLogin = !!document.getElementById("enableOIDCLogin")?.checked; |
| 9704 | const proxyOnlyEnabled = !!document.getElementById("authBypass")?.checked; |
| 9705 | const oidcPublicClient = !!document.getElementById("oidcPublicClient")?.checked; |
| 9706 | |
| 9707 | const authHeaderName = |
| 9708 | (document.getElementById("authHeaderName")?.value || "").trim() || |
| 9709 | "X-Remote-User"; |
| 9710 | |
| 9711 | const payload = { |
| 9712 | header_title: document.getElementById("headerTitle")?.value || "", |
| 9713 | publishedUrl: (() => { |
| 9714 | const el = document.getElementById("publishedUrl"); |
| 9715 | if (!el) return ""; |
| 9716 | if (el.dataset.locked === "1") return el.value || ""; |
| 9717 | return (el.value || "").trim(); |
| 9718 | })(), |
| 9719 | ffmpegPath: (() => { |
| 9720 | const el = document.getElementById("ffmpegPath"); |
| 9721 | if (!el) return ""; |
| 9722 | if (el.dataset.locked === "1") return el.value || ""; |
| 9723 | return (el.value || "").trim(); |
| 9724 | })(), |
| 9725 | ignoreRegex: (document.getElementById("ignoreRegex")?.value || "").trim(), |
| 9726 | loginOptions: { |
| 9727 | // Backend still expects “disable*” flags: |
| 9728 | disableFormLogin: !enableFormLogin, |
| 9729 | disableBasicAuth: !enableBasicAuth, |
| 9730 | disableOIDCLogin: !enableOIDCLogin, |
| 9731 | authBypass: proxyOnlyEnabled, |
| 9732 | authHeaderName, |
| 9733 | }, |
| 9734 | enableWebDAV: !!document.getElementById("enableWebDAV")?.checked, |
| 9735 | safeUploadPolicy: (document.getElementById("safeUploadPolicy")?.value || "strict").trim(), |
| 9736 | sharedMaxUploadSize: parseInt( |
| 9737 | document.getElementById("sharedMaxUploadSize").value || "0", |
| 9738 | 10 |
| 9739 | ) || 0, |
| 9740 | oidc: { |
| 9741 | providerUrl: document.getElementById("oidcProviderUrl").value.trim(), |
| 9742 | redirectUri: document |
| 9743 | .getElementById("oidcRedirectUri") |
| 9744 | .value.trim(), |
| 9745 | debugLogging: !!document.getElementById("oidcDebugLogging")?.checked, |
| 9746 | allowDemote: !!document.getElementById("oidcAllowDemote")?.checked, |
| 9747 | publicClient: oidcPublicClient, |
| 9748 | groupClaim: (document.getElementById("oidcGroupClaim")?.value || "").trim(), |
| 9749 | extraScopes: (document.getElementById("oidcExtraScopes")?.value || "").trim(), |
| 9750 | // clientId/clientSecret added conditionally below |
| 9751 | }, |
| 9752 | globalOtpauthUrl: document |
| 9753 | .getElementById("globalOtpauthUrl") |
| 9754 | .value.trim(), |
| 9755 | branding: { |
| 9756 | customLogoUrl: (document.getElementById("brandingCustomLogoUrl")?.value || "").trim(), |
| 9757 | headerBgLight: (document.getElementById("brandingHeaderBgLight")?.value || "").trim(), |
nothing calls this directly
no test coverage detected