Skip to content

Commit

Permalink
fix: access token doesn't generate errors when token expires
Browse files Browse the repository at this point in the history
  • Loading branch information
julianramirez2 committed Oct 10, 2023
1 parent 2589168 commit ee0a720
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions includes/model/class-openedx-woocommerce-plugin-api-calls.php
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,11 @@ public function enrollment_send_request( $enrollment_data, $enrollment_action )
}

$access_token = $this->check_access_token();

if ( 'array' === gettype( $access_token ) ) {
$access_token = $access_token[1];
}

$user = $this->get_user( $enrollment_data['enrollment_email'], $access_token );

Check warning on line 135 in includes/model/class-openedx-woocommerce-plugin-api-calls.php

View workflow job for this annotation

GitHub Actions / PHPCS check

Equals sign not aligned correctly; expected 1 space but found 9 spaces

if ( 'error' === $access_token[0] || 'error' === $user[0] ) {
Expand Down

0 comments on commit ee0a720

Please sign in to comment.