javascript - Facebook redirect if not logged in -
i'm using facebook auth , i'm trying add automatic redirect interior pages log in page if user not logged in or haven't authorized app, , part works fine. problem i'm having when arrive on index.php, redirects index.php again, , again, infinitely. i've tried numerous things, if (location.href == "index.php") nothing, else redirect, nothing try works.
fb.getloginstatus(function(response) { if (response.status === 'connected') { var uid = response.authresponse.userid; var accesstoken = response.authresponse.accesstoken; } else if (response.status === 'not_authorized') { window.location = "index.php"; } else { window.location = "index.php"; } });
Comments
Post a Comment