2012-04-18 7 views
1

Facebookは今日javascript sdk autheticationで何か変更しましたか?私はFB Javascript SDK Authetication written by Mahmud Ahsanを使用しましたが、今日まではすべてうまくいきました。今はFB.logout()に問題があります。ログインするにはhis demoを入力し、[ログアウト]ボタンをクリックしてください。このボタンをもう一度押してログインするようにしてください。それは応答しません。 Firebug:FB.logout()はアクセストークンなしで呼び出されました。誰かがFB.logoutメソッドにアクセストークンを追加する方法を知っているかもしれません。この変更に関するドキュメントへのリンクがありますか?Facebookは今日javascript sdk autheticationで何か変わったのですか?

マイauthetication:

window.fbAsyncInit = function() { 
FB.init({ appId: '*************', 
    status: true, 
    cookie: true, 
    channelUrl: '//localhost/website/channel.html', // Channel File 
    xfbml: true, 
    oauth: true}); 

// run once with current status and whenever the status changes 
FB.getLoginStatus(updateButton); 
FB.Event.subscribe('auth.statusChange', updateButton); 
}; 



var button,userInfo; 

function updateButton(response) { 
    button  = document.getElementById('fb-auth'); 
    userInfo  = document.getElementById('userInfo'); 

    if (response.authResponse){ 

    FB.api('/me', function(info) { 
    login(response, info); //function will just change text on the button.. 
    }); 

    button.onclick = function() { 
     FB.logout(function(response) { //here we are, FB.logout method =\ 
      logout(response); //function will just change text on the button.. 
     }); 
    }; 
} else { 

    button.innerHTML = 'Login'; 
    button.onclick = function() { 
     showLoader(true); 
     FB.login(function(response) { 
      if (response.authResponse) { 
       FB.api('/me', function(info) { 
        login(response, info); 
        });  
      } else { 
       //user cancelled login or did not grant authorization 

       alert('you are not logged in to facebook or have not granted this app basic permissins. please log in and grand basic permissins to user this application'); 
      } 
     }, {scope:'email,user_birthday,user_about_me'}); 
    } 
} 
} 
+0

は誰もが知っていますか?助言がありますか? – Denis

答えて

0

は解決します! FB.event.subscribeで問題が発生しました。私はちょうど別のリスナーにauth.statusChangeを変更しています - auth.authResponseChange

関連する問題