Move check for valid access token to the right place

This commit is contained in:
Zach Copley 2011-09-27 16:59:10 +00:00
parent ec53e68cf2
commit cd30c94096

View File

@ -44,11 +44,12 @@ class FacebookfinishloginAction extends Action
if (isset($_COOKIE['fb_access_token'])) { if (isset($_COOKIE['fb_access_token'])) {
$this->accessToken = $_COOKIE['fb_access_token']; $this->accessToken = $_COOKIE['fb_access_token'];
}
if (empty($this->accessToken)) { if (empty($this->accessToken)) {
$this->clientError(_m("Unable to authenticate you with Facebook.")); $this->clientError(_m("Unable to authenticate you with Facebook."));
return false; return false;
} }
}
$graphUrl = 'https://graph.facebook.com/me?access_token=' . urlencode($this->accessToken); $graphUrl = 'https://graph.facebook.com/me?access_token=' . urlencode($this->accessToken);
$this->fbuser = json_decode(file_get_contents($graphUrl)); $this->fbuser = json_decode(file_get_contents($graphUrl));