SSO with wordpress help

This has not been added to the WP Discourse code. If the code snippet from my previous post is not working for you, then it seems likely that something has changed with the Profile Builder plugin. I’ll take a look at what’s going on with it.

Edit: I just installed the Profile Builder plugin and configured it to ‘Enable Private Website.’ My login page on WordPress is at /log-in

When I set the WP Discourse ‘Path to your Login Page’ option to /log-in, and add the following code to my theme’s functions.php file, I am being correctly redirected back to Discourse during the SSO login process:

add_filter( 'login_redirect', 'wpdc_login_redirect_override' );
function wpdc_login_redirect_override( $redirect ) {
    $output = [];
    parse_str( parse_url( $redirect, PHP_URL_QUERY ), $output );
    if ( isset( $output['redirect_to'] ) ) {
        return $output['redirect_to'];
    }

    return $redirect;
}

If this isn’t working for you, it’s possible that the problem is being caused by something other than the Profile Builder plugin.