Skip to content

Commit

Permalink
fix: Ensure custom tenant domains are formatted correctly (#633)
Browse files Browse the repository at this point in the history
  • Loading branch information
evansims authored Jun 6, 2022
1 parent bd78508 commit b390b4b
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 2 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -17,3 +17,4 @@ psalm.xml.dist
rector.php
phpdoc.phar
.phpdoc
phpdoc.dist.xml
2 changes: 1 addition & 1 deletion src/Configuration/SdkConfiguration.php
Original file line number Diff line number Diff line change
Expand Up @@ -468,7 +468,7 @@ private function onStateChange(
throw \Auth0\SDK\Exception\ConfigurationException::validationFailed($propertyName);
}

if ($propertyName === 'domain') {
if ($propertyName === 'domain' || $propertyName === 'customDomain') {
if (is_string($propertyValue) && mb_strlen($propertyValue) !== 0) {
$host = parse_url($propertyValue, PHP_URL_HOST);
return $host ?? $propertyValue;
Expand Down
2 changes: 1 addition & 1 deletion tests/Unit/Configuration/SdkConfigurationTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -288,7 +288,7 @@

$sdk = new SdkConfiguration([
'domain' => $domain,
'customDomain' => $customDomain,
'customDomain' => 'test://' . $customDomain,
'cookieSecret' => uniqid(),
'clientId' => uniqid(),
'redirectUri' => uniqid(),
Expand Down

0 comments on commit b390b4b

Please sign in to comment.