X-Git-Url: https://git.m6w6.name/?a=blobdiff_plain;ds=sidebyside;f=app%2FGithub%2FAPI.php;h=8cff984c4707bb2645c7ecc5bcf06069a83f9442;hb=303950054385d4c55cfef9a8828ee79420b7366e;hp=bddd1672789b7d9b467dc0d6598ddea6982afa1b;hpb=9e35d9e1f6adb610b17e940616cd1dc4ec8aa0d7;p=pharext%2Fpharext.org diff --git a/app/Github/API.php b/app/Github/API.php index bddd167..8cff984 100644 --- a/app/Github/API.php +++ b/app/Github/API.php @@ -101,7 +101,14 @@ class API } function hasToken() { - return $this->tokens->get("access_token"); + if ($this->tokens->get("access_token", $token)) { + $access_token = $token->getValue(); + if (isset($access_token)) { + return true; + } + $this->dropToken(); + } + return false; } function setToken($token) { @@ -143,7 +150,7 @@ class API function fetchToken($code, $state) { if (!$this->tokens->get("state", $orig_state, true)) { if (isset($orig_state)) { - $this->logger->notice("State expired", $orig_state); + $this->logger->notice("State expired", compact("state", "orig_state")); throw new Exception\StateExpired($orig_state->getLTL()); } throw new Exception\StateNotSet;