Forum Replies Created

Viewing 2 replies - 1 through 2 (of 2 total)
  • Update: ended up with introducing own solution.
    The workaround with native php session works, but not really nice: the Social Login plugin successfully logs in, but redirect url always points to main domain, without any subdomains (used WORDPRESS_SOCIAL_LOGIN_HYBRIDAUTH_ENDPOINT_URL constant, which is always on main domain, as result on successful login browser was redirected to same domain).

    To solve the issue, replaced WORDPRESS_SOCIAL_LOGIN_PLUGIN_URL and WORDPRESS_SOCIAL_LOGIN_HYBRIDAUTH_ENDPOINT_URL constants with own functions, which build urls dynamically, based on current HOST. :

    homeurls.php
    ===========================

    <?php
    function wsl_plugin_url()
    {
    	$protocol = ((!empty($_SERVER['HTTPS']) && $_SERVER['HTTPS'] != 'off') || $_SERVER['SERVER_PORT'] == 443) ? 
    		"https://" : "http://";
    	$domainName = $_SERVER['HTTP_HOST'];
    	
    	$plugin_url = plugin_dir_url( __FILE__ );
    	$plugin_path = parse_url($plugin_url, PHP_URL_PATH);
    	return $protocol.$domainName.$plugin_path;
    }
    
    function wsl_hybridauth_url()
    {
    	$hybridauth_url = wsl_plugin_url() . 'hybridauth/';
    	return $hybridauth_url;
    }

    ================================

    then replaced all constants usages with

    require_once WORDPRESS_SOCIAL_LOGIN_ABS_PATH . "homeurls.php";
    ... wsl_hybridauth_url() ... instead of  WORDPRESS_SOCIAL_LOGIN_HYBRIDAUTH_ENDPOINT_URL 
    ... wsl_plugin_url() ... instead of  WORDPRESS_SOCIAL_LOGIN_PLUGIN_URL 

    Now I don’t need the native session support. And user becomes logged in domain he uses.

    Okay, seems I’ve found some workaround solution in the WPSL issue tracker:
    https://github.com/miled/wordpress-social-login/issues/201

    not really what I expected to be used as solution, but works for me.

Viewing 2 replies - 1 through 2 (of 2 total)