Skip to content

Commit

Permalink
Facebook login issue #510
Browse files Browse the repository at this point in the history
@scott, @pupi1985

This fix is written and verified by http://question2answer.org/qa/user/Dan+D. in below thread http://question2answer.org/qa/56966/facebook-login-stopped-working-its-not-even-working-your-site?show=56992#a56992
also see #510

I'm just submitting code changes.

Please check line no 593 for currentUrl. 

Thanks to Q2A user Dan D, and Github users valan, iamdand, cksagherian for this patch.
  • Loading branch information
ProThoughts committed Apr 1, 2017
1 parent a8d607d commit 2da5fd7
Showing 1 changed file with 7 additions and 9 deletions.
16 changes: 7 additions & 9 deletions qa-plugin/facebook-login/base_facebook.php
Expand Up @@ -372,18 +372,17 @@ public function setExtendedAccessToken() {
return false;
}

$response_params = array();
parse_str($access_token_response, $response_params);

if (!isset($response_params['access_token'])) {
$response = json_decode($access_token_response);
if (!isset($response->access_token)) {
return false;
}

$this->destroySession();

$this->setPersistentData(
'access_token', $response_params['access_token']
'access_token', $response->access_token
);

}

/**
Expand Down Expand Up @@ -789,13 +788,12 @@ protected function getAccessTokenFromCode($code, $redirect_uri = null) {
return false;
}

$response_params = array();
parse_str($access_token_response, $response_params);
if (!isset($response_params['access_token'])) {
$response = json_decode($access_token_response);
if (!isset($response->access_token)) {
return false;
}
return $response->access_token;

return $response_params['access_token'];
}

/**
Expand Down

0 comments on commit 2da5fd7

Please sign in to comment.