Skip to content

Commit

Permalink
Merge pull request #6 from softonic/feature/enable_oauth_host_env_var…
Browse files Browse the repository at this point in the history
…iable

Enable OAuthHost ENV Variable
  • Loading branch information
Serginyu authored Dec 6, 2023
2 parents ffbfe96 + d73185a commit 2b68b8c
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions src/Provider/Softonic.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,10 @@ class Softonic extends AbstractProvider
{
use BearerAuthorizationTrait;

const OAUTH_HOSTNAME = 'oauth-v3.softonic.com';
private function getOAuthHost(): string
{
return getenv('OAUTH_HOST') ?: 'https://oauth-v3.softonic.com';
}

/**
* Returns the base URL for authorizing a client.
Expand All @@ -23,7 +26,7 @@ class Softonic extends AbstractProvider
*/
public function getBaseAuthorizationUrl()
{
return 'https://' . static::OAUTH_HOSTNAME . '/authorize';
return $this->getOAuthHost() . '/authorize';
}

/**
Expand All @@ -37,7 +40,7 @@ public function getBaseAuthorizationUrl()
*/
public function getBaseAccessTokenUrl(array $params)
{
return 'https://' . static::OAUTH_HOSTNAME . '/token';
return $this->getOAuthHost() . '/token';
}

/**
Expand Down

0 comments on commit 2b68b8c

Please sign in to comment.