You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When a user who is logged-in (and has two-factor configured) visits the wp-login.php page, their authentication state is cleared. The clearing should happen only during the two-factor login workflow.
By default, WP core redirects users to the dashboard if they visit wp-login.php while being already logged in. This is not happening and prevents other plugins that rely on the logged-in state on the wp-login.php page from functioning.
This happens because the function attached to wp_login is running the logic even outside of the login flow:
There is no reason to fire the wp_login callback on every request -- rather, it should get applied only during the two-factor login flow. Ideally, we would apply the filter from another function that is known to fire during the two-factor login process.
We already run a similar logic for clearing the auth cookies:
Describe the bug
When a user who is logged-in (and has two-factor configured) visits the wp-login.php page, their authentication state is cleared. The clearing should happen only during the two-factor login workflow.
By default, WP core redirects users to the dashboard if they visit wp-login.php while being already logged in. This is not happening and prevents other plugins that rely on the logged-in state on the wp-login.php page from functioning.
This happens because the function attached to
wp_login
is running the logic even outside of the login flow:two-factor/class-two-factor-core.php
Lines 641 to 653 in 80e76ef
Steps to Reproduce
Screenshots, screen recording, code snippet
Environment information
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
The text was updated successfully, but these errors were encountered: