From 8382bc7ae99e307a73237f0f9f0b6055273e03bf Mon Sep 17 00:00:00 2001 From: OE6DXD Date: Mon, 16 Mar 2026 13:42:13 +0100 Subject: [PATCH] allow OTP login for all users when plugin is active Treat requested OTP auth as globally available whenever an OTP auth method plugin is enabled, independent of per-user enabledAuthMethods. This keeps OTP usable for all users without requiring per-user method toggles. --- server/index.js | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/server/index.js b/server/index.js index da36db9..10450b9 100644 --- a/server/index.js +++ b/server/index.js @@ -2047,6 +2047,12 @@ function preferredAuthMethodId(methods) { function resolveAuthMethodForUser(user, requestedMethodId) { const all = listPublicAuthMethods(); + if (requestedMethodId) { + const requestedPublic = all.find((entry) => entry.id === requestedMethodId) || null; + if (requestedPublic && requestedPublic.type === "otp") { + return requestedPublic; + } + } const enabledSet = new Set(Array.isArray(user.enabledAuthMethods) ? user.enabledAuthMethods : []); const allowed = all.filter((entry) => enabledSet.has(entry.id)); if (allowed.length === 0) {