Skip to content

Commit

Permalink
Merge pull request #207 from plausible/require_api_token_self_hosted
Browse files Browse the repository at this point in the history
Fixed: API client host is set to host_domain_url.
  • Loading branch information
Dan0sz authored May 17, 2024
2 parents 571c8dc + 8ca30be commit a3e0a03
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/Client.php
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,8 @@ class Client {
*/
public function __construct( $token = '' ) {
$config = Configuration::getDefaultConfiguration()->setUsername( 'WordPress' )->setPassword(
$token ?: Helpers::get_settings()[ 'api_token' ]
);
$token ?: Helpers::get_settings()[ 'api_token' ]
)->setHost( Helpers::get_hosted_domain_url() );
$this->api_instance = new DefaultApi( new GuzzleClient(), $config );
}

Expand Down

0 comments on commit a3e0a03

Please sign in to comment.