MCPcopy Create free account
hub / github.com/error311/FileRise / openTOTPLoginModal

Function openTOTPLoginModal

public/js/auth.js:202–223  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

200
201// wrap the TOTP modal opener to disable other login buttons only for Basic/OIDC flows
202function openTOTPLoginModal() {
203 originalOpenTOTPLoginModal();
204
205 const isFormLogin = Boolean(window.__lastLoginData);
206 if (!isFormLogin) {
207 // disable Basic‑Auth link
208 const basicLink = document.querySelector('a[href$="api/auth/login_basic.php"], a[href$="/api/auth/login_basic.php"]');
209 if (basicLink) {
210 basicLink.style.pointerEvents = 'none';
211 basicLink.style.opacity = '0.5';
212 }
213 // disable OIDC button
214 const oidcBtn = document.getElementById("oidcLoginBtn");
215 if (oidcBtn) {
216 oidcBtn.disabled = true;
217 oidcBtn.style.opacity = '0.5';
218 }
219 // hide the form login
220 const authForm = document.getElementById("authForm");
221 if (authForm) authForm.style.display = 'none';
222 }
223}
224
225/* ----------------- Utility Functions ----------------- */
226function updateItemsPerPageSelect() {

Callers 1

auth.jsFile · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected