lundi 2 mai 2016

Laravel socialite popup

I'm following this instruction from another thread. Simple example of popup. The problem is I cant make it work on my Laravel app. I'm not quite knowledgeable about cookie and I'm not sure what to do with $('#UserInfo').text($.cookie("some_cookie")); in the code.

I have made the facebook login to popup. The problem is that when I was successfully logged-in, It wont close the popup instead, it loads the redirect path to it.

I want to close the popup window once successfully logged in and then load the next route to the parent.

<input id="btn-facebook" type="button" value="Connect with Facebook" />
<script src=""></script>
<script>
    var signinWin;
    $('#btn-facebook').click(function () {
         //   var pos = screenCenterPos(800, 500);
            signinWin = window.open("{!!URL::to('facebook')!!}", "SignIn", "width=780,height=410,toolbar=0,scrollbars=0,status=0,resizable=0,location=0,menuBar=0,left=" + 500 + ",top=" + 200);
            setTimeout(CheckLoginStatus, 2000);
            signinWin.focus();
            return false;
        });

    function CheckLoginStatus() {
        if (signinWin.closed) {
            $('#UserInfo').text($.cookie("some_cookie"));
        }
        else setTimeout(CheckLoginStatus, 1000);
    }

</script>



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire