Search code examples
javascriptfacebooksdktoken

Facebook javascript sdk suddenly stopped working


My FB JS SDK script suddenly stop working. My code is:

FB.init({appId:facebook.appId, version:'v2.7'});
FB.login(function(response){
    console.log(response);
    if(response.authResponse){
        FB.api('/me',  function(response){
            console.log(response);
        });
    }
},{scope:'public_profile'});

First log gave me an array with status "connected" and "authResponse" array. After that I see an error:

GET https://graph.facebook.com/v2.7/me?access_token=EAALFKWrB6...&method=get&pretty=0&sdk=joey&suppress_http_code=1 400 ()

but if I paste above url to the browser it works properly so I think it can't be "400 Bad request".

Second log gave me FB error array with message "An active access token must be used to query information about the current user".

Is it about wrong token? But it works in direct url. I have no idea what's going on.

Thanks in advance.


Solution

  • I found the problem. It was Kaspersky antivirus. After disable it all works like a charm.