Skip to content

Commit

Permalink
Enable OAuthHost ENV Variable
Browse files Browse the repository at this point in the history
  • Loading branch information
Serginyu committed Dec 6, 2023
1 parent ffbfe96 commit d73185a
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 d73185a

Please sign in to comment.