mirror of
https://github.com/beestat/app.git
synced 2025-06-01 12:46:23 -04:00
Fixed #154 - Patreon tokens are not refreshing properly
For real this time
This commit is contained in:
parent
82563f3a55
commit
22671bb7b5
@ -122,7 +122,7 @@ class patreon extends external_api {
|
|||||||
// If the token was expired, refresh it and try again. Trying again sets
|
// If the token was expired, refresh it and try again. Trying again sets
|
||||||
// auto_refresh_token to false to prevent accidental infinite refreshing if
|
// auto_refresh_token to false to prevent accidental infinite refreshing if
|
||||||
// something bad happens.
|
// something bad happens.
|
||||||
if (isset($response['errors']) === true && $response['status'] === '401') {
|
if (isset($response['errors']) === true && $response['errors'][0]['status'] === '401') {
|
||||||
// Authentication token has expired. Refresh your tokens.
|
// Authentication token has expired. Refresh your tokens.
|
||||||
if ($auto_refresh_token === true) {
|
if ($auto_refresh_token === true) {
|
||||||
$this->api('patreon_token', 'refresh');
|
$this->api('patreon_token', 'refresh');
|
||||||
@ -132,7 +132,7 @@ class patreon extends external_api {
|
|||||||
if($this::$log_mysql !== 'all') {
|
if($this::$log_mysql !== 'all') {
|
||||||
$this->log_mysql($curl_response);
|
$this->log_mysql($curl_response);
|
||||||
}
|
}
|
||||||
throw new Exception($response['status']['message']);
|
throw new Exception($response['errors'][0]['detail']);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (isset($response['errors']) === true) {
|
else if (isset($response['errors']) === true) {
|
||||||
@ -140,7 +140,7 @@ class patreon extends external_api {
|
|||||||
if($this::$log_mysql !== 'all') {
|
if($this::$log_mysql !== 'all') {
|
||||||
$this->log_mysql($curl_response);
|
$this->log_mysql($curl_response);
|
||||||
}
|
}
|
||||||
throw new Exception($response['status']['message']);
|
throw new Exception($response['errors'][0]['detail']);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
return $response;
|
return $response;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user