• Plugin is not compatible with Two Factor plugin: https://www.ads-software.com/plugins/two-factor/ – it is very useful as it adds support for hardware devices to use as 2nd factor.

    Problem is that after authenticating with 2nd factor user is redirected to my-account/?action=validate_2fa which is not processed in actions on line 23:

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

    Do you think you would have chance to address this issue?

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 Machine IT Services

    (@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.