Making WordPress.org

Changeset 12524


Ignore:
Timestamp:
04/03/2023 05:26:02 AM (2 years ago)
Author:
dd32
Message:

API: Community Calendly calendar notifications: Add a PHP Warning for when the API access token is revoked.

Calendly revokes all OAuth and PATs when the account password is changed without any UI warning, this at least warns us that the token has expired.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • sites/trunk/api.wordpress.org/public_html/dotorg/slack/community-deputies-calendly-webhook.php

    r11953 r12524  
    2626        ]
    2727    );
     28
     29    // The token was probably revoked, so we need to update it.
     30    if ( 401 === wp_remote_retrieve_response_code( $req ) ) {
     31        trigger_error(
     32            'The Calendly token has probably been revoked, the password was probably changed.' .
     33            'Please update the COMMUNITY_CALENDLY_TOKEN secrets constant with a new PAT created on https://calendly.com/integrations/api_webhooks from the WordCamp Calendly account.' .
     34            wp_remote_retrieve_body( $req ),
     35            E_USER_WARNING
     36        );
     37    }
    2838
    2939    return json_decode( wp_remote_retrieve_body( $req ) );
Note: See TracChangeset for help on using the changeset viewer.