Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Integration with "members" plugin #856

Closed
JUVOJustin opened this issue Nov 8, 2022 · 1 comment
Closed

Integration with "members" plugin #856

JUVOJustin opened this issue Nov 8, 2022 · 1 comment
Assignees

Comments

@JUVOJustin
Copy link

Describe the problem you'd like to have solved

Add a little integration with the wordpress members plugin which allows make the site only accessible after a user logged in. When enabling the "private site" feature in members alongside using auth0 an endless redirect loop occurs. I have already created an issue at the members repository. I am not sure if you or them want to add third party integrations. If not, it is probably nice to have the workaround documented here too. I would love to see this baked in, since other plugins will create similar issues e.g. buddyboss.

Describe the ideal solution

For v4 i created the following code which hooks into members. What i dont know is if the url parameters are future-proof for version 5.

add_filter('members_is_private_page', function(bool $is_private) {

    // Check if installed. Different constants for v4 and v5 of auth0 wordpress plugin
    if (!defined('WP_AUTH0_VERSION') && !defined('WPA0_VERSION')) {
        return $is_private;
    }

    // Check for url parameters
    if (
        empty($_GET['auth0']) || $_GET['auth0'] != "1"
        || empty($_GET['code'])
        || empty($_GET['state'])
    ) {
        return $is_private;
    }

    return false;
});
@evansims evansims self-assigned this Nov 12, 2022
@evansims
Copy link
Member

Hey @JUVOJustin! 👋 Thanks for your suggestion, and offering the snippet and advice for others seeking similar integrations! Adding integration support around this specific use case isn't planned right now, but I'll backlog researching this for future consideration. 👍

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Dec 12, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants