From a0288df37cddc30010df17c0152380734b0f22bb Mon Sep 17 00:00:00 2001 From: Eric Oswald Date: Mon, 16 Mar 2020 22:34:27 -0400 Subject: [PATCH] Decode OAuth response --- lib/ToornamentAPI.class.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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 +}