Support » Plugin: Force Login » Reset Password Link is Blocked with Woocommerce

  • Resolved Anonymous User 14746719

    (@anonymized-14746719)


    Hi,

    If you have woocommerce enabled the reset password link ends up trying to take you to the /my-account/lost-password/ page which is denied by this plugin and a real pain.

    It would be nice if this plugin could do 1 of the following things:

    1. Detect woocommerce is installed and redirect non-logged in users to the standard wordpress user reset screen

    2. Detect woocommerce is installed and whitelist the pages:

    /my-account/lost-password/
    /my-account/lost-password/?reset-link-sent=true

    I managed to workaround the issue by manually whitelisting the above URL’s in my functions.php but as woocommerce is so popular I think the plugin should handle this by default

    Many thanks!

    Mike

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Author Kevin Vess

    (@kevinvess)

    Hi – thanks for the feedback.

    I agree, WooCommerce is a popular plugin for turning WordPress sites into ecommerce sites. However, my focus was to create a simple and lightweight plugin that only does one thing – force visitors to log in.

    It would be a slippery slope to start accommodating other third-party plugins like WooCommerce and inevitably cause Force Login to grow in size beyond what is necessary.

    I recognize some sites might have special circumstances that require certain URLs to be accessible, which is why I included the whitelist and bypass filters to allow developers to easily bypass Force Login where needed.

    Well done on successfully accommodating the ecommerce plugin of your choice by using the v_forcelogin_whitelist filter to allow visitors to access those custom WooCommerce URLs.

    However, might I suggest you try the v_forcelogin_bypass filter with WooCommerce Conditional Tags instead? Something like this:

    /**
     * Bypass Force Login to allow for exceptions.
     *
     * @return bool Whether to disable Force Login. Default false.
     */
    function my_forcelogin_bypass( $bypass ) {
      if ( class_exists( 'WooCommerce' ) ) {
        if ( is_wc_endpoint_url( 'lost-password' ) ) {
          $bypass = true;
        }
      }
      return $bypass;
    }
    add_filter('v_forcelogin_bypass', 'my_forcelogin_bypass', 10, 1);

    Thanks for using Force Login!

    Thread Starter Anonymous User 14746719

    (@anonymized-14746719)

    Kevin,

    Thank you very much for such a detailed and informative response.

    I get why you may not want to include Woocommerce password reset support although don’t necessarily agree 🙂

    It would be good, however, if perhaps something on the plugin page was mentioned specifically about plugins that modify the user / password screens. The site was completely up and running and I thought I had tested everything, until someone complained that they forgot their password and clicking the password reset link just kept forcing them back to the login page.

    Even if a quick snippet was included in the FAQ section, it may help others avoid the same issue I did and then quickly point them to the bypass options you have available.

    Many thanks

    Mike

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Reset Password Link is Blocked with Woocommerce’ is closed to new replies.