2
자바 스크립트를 통해 내 사이트에 Facebook 로그인을 사용하려고하지만 사용자가 로그인하면 Facebook 팝업이 닫히지 않습니다. 대신 다음 메시지가 표시됩니다.Facebook 로그인 오류 (자바 스크립트)
로그인 프로세스 중에 오류가 발생할 수 있습니다. 이 창을 닫고 응용 프로그램으로 돌아 가려 할 수 있지만 다시 로그인하라는 메시지가 표시 될 수 있습니다. 이것은 응용 프로그램의 버그로 인한 것 같습니다.
다시 로그인 버튼을 클릭하면 모든 것이 정상적으로 작동합니다.
이// Load the SDK Asynchronously
(function(d){
var js, id = 'facebook-jssdk', ref = d.getElementsByTagName('script')[0];
if (d.getElementById(id)) {return;}
js = d.createElement('script'); js.id = id; js.async = true;
js.src = "//connect.facebook.net/en_US/all.js";
ref.parentNode.insertBefore(js, ref);
}(document));
// Init the SDK upon load
window.fbAsyncInit = function() {
var doLogin = function (response) {
url = '//'+window.location.hostname+'? access_token='+response.authResponse.accessToken;
window.top.location = url;
};
FB.init({
appId : 'MY_APP_ID', // App ID
status : true, // check login status
cookie : true, // enable cookies to allow the server to access the session
xfbml : true, // parse XFBML
oauth : true,
channelUrl : '//'+window.location.hostname+'/static/html/channel.html'
});
FB.Event.subscribe('auth.login', function(response) {
doLogin(response);
})
FB.getLoginStatus(function(response) {
if (response.status == 'connected') {
doLogin(response);
}
}, true);
}
로그인 버튼은 어디에 있습니까? – CBroe
큰 문제가 없습니다 :