Support Two-Factor 0.16 - #2
Merged
Merged
Conversation
Two-Factor 0.16 added a site-wide provider selection that filters both two_factor_providers and two_factor_enabled_providers_for_user. Both could silently drop the email fallback and leave users with no second factor. Keep the email provider registered and run the fallback filter after the site-wide enforcement filter. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01STLtCzgtqWf58hHC4vrJ5G
Replaces the provider re-registration and the filter priority bump with a single filter on the option both of Two-Factor 0.16's enforcement filters read, leaving the fallback filter itself unchanged. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01STLtCzgtqWf58hHC4vrJ5G
oBusk
force-pushed
the
fix/two-factor-0.16-compat
branch
from
September 21, 2026 17:39
40d40f3 to
8ac6f9c
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Two-Factor 0.16 added a site-wide provider selection page (Settings → Two-Factor, #764) backed by the
two_factor_enabled_providersoption. It enforces that selection through two filters:two_factor_providers— removes deselected providers fromTwo_Factor_Core::get_providers()entirely.two_factor_enabled_providers_for_userat priority 10, registered oninit— intersects the user's enabled providers with the selection.This plugin registers its filter at mu-plugin load, so it ran before core's at the same priority and the appended
Two_Factor_Emailkey was intersected straight back out. And with Email deselected the class is not registered at all, so the appended key resolves to nothing downstream. Either way the user logs in with no second factor, with no error.Changes
Two_Factor_Emailontwo_factor_providersatPHP_INT_MAXso the fallback always resolves to a live provider.PHP_INT_MAXso it runs after core's site-wide enforcement filter.^0.16, not^0.9— caret on 0.x resolves>=0.9 <0.10and would never install 0.16).Notes
composer.jsonstill only requiresphp. The Two-Factor plugin is not declared as a dependency because it is installed from a third-party package repository that the consuming project has to configure itself; the requirement stays documented in the README install snippet.🤖 Generated with Claude Code
https://claude.ai/code/session_01STLtCzgtqWf58hHC4vrJ5G