登录后HybridAuth弹出窗口不会关闭

问题描述

我正在为我的Yii应用程序使用hybridauth v3,

我认为我有代码

$popupScript = "function auth_popup( provider,title = 'Authentication Window',w = '500',h = '650' ){

    var dualScreenLeft = window.screenLeft != undefined ? window.screenLeft : screen.left;
    var dualScreenTop = window.screenTop != undefined ? window.screenTop : screen.top;

    width = window.innerWidth ? window.innerWidth : document.documentElement.clientWidth ? document.documentElement.clientWidth : screen.width;
    height = window.innerHeight ? window.innerHeight : document.documentElement.clientHeight ? document.documentElement.clientHeight : screen.height;

    var left = ((width / 2) - (w / 2)) + dualScreenLeft;
    var top = ((height / 2) - (h / 2)) + dualScreenTop;
    var options = 'toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no,copyhistory=no';

    var url = '".Yii::app()->createAbsoluteUrl('/usr/hybridauth/callback')."?provider='+provider;

    var authWindow = window.open(url,title,options+',width=' + w + ',height=' + h + ',top=' + top + ',left=' + left);
    
    if (window.focus) {
        authWindow.focus();
    }

    return false;
}";

Yii::app()->clientScript->registerScript(__CLASS__.'#popup',$popupScript,cclientScript::POS_END);

在我的控制器中,我尝试了close()和仍然相同的结果。

// Close pop-up window
                echo "<script>
                        //window.opener.location.replace('".$url."');
                        //window.close();
                        window.opener.location.href = '".$url."';
                        window.open('','authWindow').close();
                    </script>";

当我使用google登录时,它已登录,但弹出窗口没有关闭。并在弹出窗口中重定向。有人对此有解决方案吗?谢谢

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)

相关问答

Selenium Web驱动程序和Java。元素在(x,y)点处不可单击。其...
Python-如何使用点“。” 访问字典成员?
Java 字符串是不可变的。到底是什么意思?
Java中的“ final”关键字如何工作?(我仍然可以修改对象。...
“loop:”在Java代码中。这是什么,为什么要编译?
java.lang.ClassNotFoundException:sun.jdbc.odbc.JdbcOdbc...