拒绝在框架中显示Facebook URL,因为它将“ X-Frame-Options”设置为“拒绝”

时间:2018-10-04 09:10:38

标签: javascript angular facebook sdk

我正在Angular6应用程序之一中使用Facebook Javascript SDK来集成FB Login。如果我登录Facebook,一切正常。但是,当我从Facebook注销时,它显示错误消息Refused to display 'https://www.facebook.com/connect/ping?client_id=######&domain=######&origin=1&redirect_uri=####&response_type=token%2Csigned_request&sdk=joey&version=v3.1 in a frame because it set 'X-Frame-Options' to 'deny'.。我已经在我的Facebook应用程序仪表板中检查了oauth URL设置,它具有正确的我的域。如何解决此问题?

我正在使用的代码是:

FB.getLoginStatus(
           (response: any): void => {
               if (response.status === 'connected' && response.authResponse) {
                   FB.api('/me/permissions', (permissions) => {
                       for (let i = 0; i < permissions.data.length; i++) {
                           if (permissions.data[i].status === 'declined' && permissions.data[i].permission === 'email') {
                               emailDeclined = true;
                           }
                       }
                       if (!emailDeclined) {
                           this.userFacebookLogin(response);
                       } else {
                           this.fbLogin('rerequest');
                       }
                   });
               } else {
                 console.log('Not connected');

               }
           },
           true
       );

1 个答案:

答案 0 :(得分:0)

尝试将您的应用信息中心设置中的网站网址更改为您的开发网址。经过一段时间的封锁后,这个答案为我指明了正确的方向-https://stackoverflow.com/a/53325827/3787212