在我的React项目中,我正在使用react-facebook-login包。我刚刚上线,只有20个用户,其中2个无法登录。他们说他们填写了凭据,允许facebook登录到我的系统,而/login
页面只是刷新了自己,什么也没发生。看来他们得到的错误是:
You are overriding current access token, that means some other app is expecting different access token and you will probably break things. Please consider passing access_token directly to API parameters instead of overriding the global settings
这可能导致什么?我经历了不同的答案,但没有任何解决办法。我尝试过:
1)在Facebook开发者控制台上创建测试帐户。错误有时会显示在控制台中,有时不会显示,但是仍然会发生。
2)将与我的网域相关的所有内容都列入白名单
3)我提交了Individual Verification
的文档,但其他人说这无济于事
这是我的登录过程的样子:
<FacebookLogin
appId="<this is app id>"
autoLoad={true}
fields="name,email"
callback={responseFacebook}
disableMobileRedirect={true}
/>
我有disableMobileRedirect
due to known bug。
这是我的responseFacebook
函数:
const responseFacebook = response => {
if (response.name && response.email && response.userID) {
const isMw = attemptMwMember(response.email);
Cookies.set("name", response.name);
Cookies.set("email", response.email);
Cookies.set("isLoggedIn", true);
if (isMw) {
Cookies.set("mw", true);
} else {
Cookies.set("mw", false);
}
navigate(`/`);
window.location.reload(false);
}
};
基本上,我使用这些cookie来了解用户是否已登录,并且在我的应用程序中,我具有private
和public
路由。 Private
个正在检查是否存在上述所有cookie,如果不存在,则重定向到/login
。
有人遇到这个问题吗?我有点疯了,尤其是当它适用于大多数用户而不是某些用户时。