Title: Does not work with Two Factor plugin
Last modified: September 1, 2020

---

# Does not work with Two Factor plugin

 *  Resolved [Gytis Repečka](https://wordpress.org/support/users/kelmas/)
 * (@kelmas)
 * [5 years, 9 months ago](https://wordpress.org/support/topic/does-not-work-with-two-factor-plugin/)
 * Plugin is not compatible with Two Factor plugin: [https://wordpress.org/plugins/two-factor/](https://wordpress.org/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](https://wordpress.org/support/users/kelmas/)
 * (@kelmas)
 * [5 years, 9 months ago](https://wordpress.org/support/topic/does-not-work-with-two-factor-plugin/#post-13344641)
 * 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](https://wordpress.org/support/users/machineitsvcs/)
 * (@machineitsvcs)
 * [5 years, 9 months ago](https://wordpress.org/support/topic/does-not-work-with-two-factor-plugin/#post-13346492)
 * 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](https://wordpress.org/support/users/kelmas/)
 * (@kelmas)
 * [5 years, 8 months ago](https://wordpress.org/support/topic/does-not-work-with-two-factor-plugin/#post-13348473)
 * 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.

 * ![](https://ps.w.org/woo-wp-login/assets/icon.svg?rev=1791181)
 * [Redirect Login to WooCommerce "My account" Page](https://wordpress.org/plugins/woo-wp-login/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/woo-wp-login/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/woo-wp-login/)
 * [Active Topics](https://wordpress.org/support/plugin/woo-wp-login/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/woo-wp-login/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/woo-wp-login/reviews/)

## Tags

 * [2fa](https://wordpress.org/support/topic-tag/2fa/)
 * [login](https://wordpress.org/support/topic-tag/login/)
 * [redirect](https://wordpress.org/support/topic-tag/redirect/)

 * 3 replies
 * 2 participants
 * Last reply from: [Gytis Repečka](https://wordpress.org/support/users/kelmas/)
 * Last activity: [5 years, 8 months ago](https://wordpress.org/support/topic/does-not-work-with-two-factor-plugin/#post-13348473)
 * Status: resolved