我们的一些用户在登录时陷入无限循环。 用户已经授权发送电子邮件。我们的应用程序想要访问邮件但无法访问。它将用户重定向到授权页面。但Facebook将他送回应用程序,因为它知道已经授予了auth。
这是在一天前开始的,只有部分用户受到影响..
非常感谢您的帮助。
答案 0 :(得分:0)
$user_id = $facebook->getUser();
if ($user_id) {
try {
// Proceed knowing you have a logged in user who's authenticated.
$user_profile = $facebook->api('/me');
print_r($user_profile);
} catch (FacebookApiException $e) {
error_log($e."brr".$user_id);
$user_id = null;
}
}
if(!$user_id||!$user_profile['email']){
$auth_url="https://www.facebook.com/dialog/oauth?client_id=".$appid."&redirect_uri=".$canvasurl.$reflek."&scope=email"; //&scope=email,read_stream
echo "<script> top.location.href='" .$auth_url . "'</script>";
die();
}