mirror of
https://github.com/10h30/wp-strava.git
synced 2026-06-05 15:10:01 +09:00
Merge pull request #112 from cmanon/feature/109-error-unauthorized
Added extra debugging
This commit is contained in:
@@ -138,6 +138,7 @@ On the WP-Strava settings page you cannot currently remove and add another athle
|
||||
Add ability to paste Activity/Route/Segment URL into the block editor and have it insert the appropriate block https://wordpress.org/support/topic/sorry-this-content-could-not-be-embedded-5/
|
||||
Add `reduce_polyline()` for maps with large polylines but no summary provided (prevents empty map) https://wordpress.org/support/topic/map-embed-from-segment-shows-default-map/
|
||||
Fix for ActivitiesList where lists were showing all zeroes https://wordpress.org/support/topic/zero-on-all-activities-for-club-on-list-mocule/
|
||||
Add additional authorization error logging to troubleshoot 401 Unauthorized https://wordpress.org/support/topic/wp-strava-error-401-unauthorized/
|
||||
|
||||
|
||||
= 2.9.1 =
|
||||
|
||||
@@ -39,12 +39,23 @@ class WPStrava_AuthRefresh extends WPStrava_Auth {
|
||||
/**
|
||||
* Cron method to refresh auth tokens from Strava.
|
||||
*
|
||||
* @throws WPStrava_Exception
|
||||
* @author Justin Foell
|
||||
* @since 2.0.0
|
||||
*/
|
||||
public function auth_refresh() {
|
||||
$settings = WPStrava::get_instance()->settings;
|
||||
foreach ( $settings->info as $client_id => $info ) {
|
||||
$info = $settings->info;
|
||||
|
||||
if ( ! is_array( $info ) ) {
|
||||
$message = 'strava_info should be an array, received: ' . var_export( $info, true ); // phpcs:ignore WordPress.PHP.DevelopmentFunctions.error_log_var_export -- Debug only.
|
||||
if ( WPSTRAVA_DEBUG ) {
|
||||
error_log( $message ); // phpcs:ignore WordPress.PHP.DevelopmentFunctions.error_log_error_log -- Debug only.
|
||||
}
|
||||
throw new WPStrava_Exception( $message );
|
||||
}
|
||||
|
||||
foreach ( $info as $client_id => $info ) {
|
||||
if ( ! empty( $info->refresh_token ) ) {
|
||||
$this->token_exchange_refresh( $client_id, $info );
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user