JS:如何使FB登录按钮无法在登录后自动将我登录到网站

时间:2019-01-17 20:10:39

标签: javascript facebook

我有一个FB登录按钮,如果我在另一个标签上登录了Facebook,则我的站点按钮显示为“ LOG OUT”,就好像它是自动登录一样。问题在于何时

响应状态以“已连接”状态返回,因此它在尝试访问网站时尝试访问我的网站后端以验证该帐户是否正确,因为我有另一个选项卡已登录了我的Facebook帐户。

function statusChangeCallback(response) {
  if (response && response.authResponse && response.authResponse.accessToken) {

     Cookies.set("facebookToken",response.authResponse.accessToken, { expires: 7 })
  }
  // The response object is returned with a status field that lets the
  // app know the current login status of the person.
  // Full docs on the response object can be found in the documentation
  // for FB.getLoginStatus().
  if (response.status === 'connected') {

    backendAPILogin();
  } else {
    // The person is not logged into your app or we are unable to tell.

  }
}

0 个答案:

没有答案