Skip to content

Commit

Permalink
Fixed: don't attempt to validate API token if self_hosted_domain is e…
Browse files Browse the repository at this point in the history
…ntered.
  • Loading branch information
Dan0sz committed Feb 26, 2024
1 parent 3ad9be9 commit d4a53c4
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/Ajax.php
Original file line number Diff line number Diff line change
Expand Up @@ -158,6 +158,7 @@ public function toggle_option() {
/**
* Save Options
* @return void
* @throws ApiException
*/
public function save_options() {
// Sanitize all the post data before using.
Expand All @@ -179,7 +180,7 @@ public function save_options() {
$settings[ $option->name ] = trim( $option->value );

// Validate API token, if this is the API token field.
if ( $option->name === 'api_token' ) {
if ( $option->name === 'api_token' && empty( $settings[ 'self_hosted_domain' ] ) ) {
$this->validate_api_token( $option->value );
}
}
Expand Down

0 comments on commit d4a53c4

Please sign in to comment.