• Resolved abramliddell

    (@abramliddell)


    Hi! I’ve worked out that this Defender’s 2FA doesn’t work when paired with WooCommerce… At least on my site anyway.

    When logging in, I input my username and password. It seems like a success until I enter the 2FA code. The page then reverts back to the login screen with two errors:

    Error: The username field is empty.
    Error: The password field is empty.

    The only way I’ve been able to login is by removing WooCommerce via SSH, or by removing 2FA once doing that and then logging in again.

    This issue occurs in /wp-admin and in the default WooCommerce nav bar login button.

    Help would be appreciated!
    Thanks!

    • This topic was modified 3 years, 7 months ago by abramliddell.

    The page I need help with: [log in to see the link]

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Support Williams – WPMU DEV Support

    (@wpmudev-support8)

    Hi @abramliddell

    I hope you’re well today and thank you for contacting us!

    Are you using also WooCommerce Payments (by Automattic) plugin on site as well?

    If yes then this is a known compatibility bug that we’ve discovered just recently. Our developers are already aware of it and are working on the fix that should be included with one of upcoming updates (though I don’t have an ETA yet, I’m afraid).

    As a “patch” for now, you can try adding following code to the site as a MU plugin

    <?php 
    function wpmudev_set_cookie_on_current_request( $cookie ) {
        if ( ! is_user_logged_in() && isset( $_COOKIE[ LOGGED_IN_COOKIE ] ) ) {
            unset( $_COOKIE[ LOGGED_IN_COOKIE ] );
        }
    }
    
    add_action( 'set_logged_in_cookie', 'wpmudev_set_cookie_on_current_request', 999);

    – create an empty file with a .php extension (e.g. “defender-woo-twofa-fix.php”)
    – copy and paste that code into it
    – save the file and upload it to the “/wp-content/mu-plugins” of your site’s WordPress installation; if there’s no “mu-plugins” folder in “wp-content”, just create an empty one first.

    Best regards,
    Adam

    Plugin Support Patrick – WPMU DEV Support

    (@wpmudevsupport12)

    Hi @abramliddell

    I hope you are doing well and safe!

    We haven’t heard from you in a while, I’ll mark this thread as resolved.

    Feel free to let us know if you have any additional questions or problems.

    Best Regards
    Patrick Freitas

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘ERROR: The username/password field is empty’ is closed to new replies.