-
Notifications
You must be signed in to change notification settings - Fork 169
Description
Describe the bug
If there are no two-factor providers enabled, the corresponding profile section is still rendered on the user settings page. This creates a visual inconsistency in scenarios where two-factor authentication needs to be disabled for a specific user or group of users.
Expected behavior: Users should not see the two-factor section in their profile settings if there are no providers currently available.
Actual behavior: Users always see the two-factor section in their profile settings even if there are no providers currently available. (See screenshot)
Steps to Reproduce
This filter will disable all providers:
add_filter(
'two_factor_providers',
function ( $providers ) {
return [];
},
9999
);
Of course this code is for demonstration purposes only. Actual code would likely use two_factor_enabled_providers_for_user
and perform some check on the user ID first. The result, however, is the same.
Screenshots, screen recording, code snippet
Environment information
WordPress 6.7.1, plugin version 0.11.0
Please confirm that you have searched existing issues in this repository.
Yes
Please confirm that you have tested with all plugins deactivated except Two-Factor.
Yes