diff --git a/lib/ToornamentAPI.class.php b/lib/ToornamentAPI.class.php index 269e1c4a..adacb40f 100644 --- a/lib/ToornamentAPI.class.php +++ b/lib/ToornamentAPI.class.php @@ -29,6 +29,7 @@ public function retrieveKey() if (!file_exists($filename) || @filemtime($filename) + 60 * 60 * 24 < time()) { $this->token = $this->requestOAuth2(); file_put_contents($filename, $this->token); + $this->token = json_decode($this->token, true); } else { $this->token = json_decode(file_get_contents($filename), true); } @@ -160,4 +161,4 @@ private function requestOAuth2() throw new Exception("{$this->baseUrl}oauth/v2/token returned $httpcode"); } } -} \ No newline at end of file +}