Skip to content

Commit

Permalink
fix fetch code
Browse files Browse the repository at this point in the history
  • Loading branch information
glena committed Dec 30, 2016
1 parent fdf1f6c commit d02f462
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/API/Oauth2Client.php
Original file line number Diff line number Diff line change
Expand Up @@ -237,7 +237,11 @@ private function dontPersist($name) {
* @return Boolean Whether it exchanged the code or not correctly
*/
public function exchangeCode() {
$code = isset($_GET['code']) ? $_GET['code'] : $_POST['code'];

$code = isset($_GET['code'])
? $_GET['code']
: ( isset($_POST['code']) ? $_POST['code'] : null );

if (!isset($code)) {
$this->debugInfo("No code found in _GET or _POST params.");
return false;
Expand Down

0 comments on commit d02f462

Please sign in to comment.