Hi, thanks for using Force Login!
If you deactivate Force Login, are you still having issues?
No, it works perfectly fine once Force Login is disabled
Could I maybe whitelist a certain IP address? Is that possible?
You can bypass Force Login based on any condition by adding the v_forcelogin_bypass filter to your site. Check out the FAQs for an example.
I can see how to use this for pages on my website, but how would I whitelist all of REST API? I do not have URLs for them, as it all behind-the-scenes through a plugin I use
You said you commented out the REST API code in Force Login and that it still wasn’t working. I assumed you were now asking about how to bypass the login redirect.
The v_forcelogin_bypass filter should return a true|false boolean value to determine whether or not Force Login runs. Your condition can be checking if the visitor’s IP address matches the one(s) you want to allow.
However, if you issue isn’t with the force login redirect, but with Force Login’s restriction to the REST API for authorized users, you may allow the REST API to be publicly accessible again by adding one of the following code snippets to your functions.php file:
add_filter( 'rest_authentication_errors', '__return_true' );
OR
remove_filter( 'rest_authentication_errors', 'v_forcelogin_rest_access', 99 );
I have tried both of those code snippets separately in my functions.php file with no luck. Any other ideas?
If removing the REST API restriction (either with filters or code commenting) does not resolve the issue, then I would assume that is not the cause of the issue.
Maybe try enabling WP_DEBUG mode and checking your error logs for any clues of what’s failing and where.
You might need to dig into the Gravity Flow Form Connector plugin code to see what that plugin is trying to do and when, to figure out how to allow Force Login to bypass it.
Let me know if you figure out what the cause is and what your solution ends up being.
Good luck!