Support » Plugin: WooCommerce WP-Login » Does not work with Two Factor plugin

Viewing 3 replies - 1 through 3 (of 3 total)
  • Thread Starter Gytis Repečka

    (@kelmas)

    It is enough to add validate_2fa to following array:

    if('wp-login.php' == $pagenow && (!isset($_GET['action']) || !in_array($_GET['action'], array("logout", "rp", "resetpass", "resetpassword", "enter_recovery_mode", "validate_2fa"))) && !isset($_REQUEST['interim-login'])) {

    Of course we could first check if two-factor/two-factor.php plugin exists or not and then append validate_2fa to array but it requires a bit of refactoring then.

    Plugin Author MachineITSvcs

    (@machineitsvcs)

    This was a pretty easy fix, so I just implemented it. Unfortunately, due to the specificity/uniqueness of your request, I was not comfortable just adding this to the array. Instead, I’ve added the ability to pass additional actions to the plugin within the functions.php file of your child theme or a mu-plugins. This is available in the new version of the plugin. You should be able to just add the following line to one of these locations:

    add_filter('woo_wp_login_actions', function($actions) {
        $actions[] = "validate_2fa";
        return $actions;
    });

    This will add your action to the new filter (note that it is an array it is adding to. To prevent accidental emptying of the array, I’m adding the other values to check after the fact. Let me know if you have any issues or other questions.

    Thread Starter Gytis Repečka

    (@kelmas)

    Thanks, this solution works smooth.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Does not work with Two Factor plugin’ is closed to new replies.