Skip to content

Commit

Permalink
FIX for wrong domain name while using base install subpaths
Browse files Browse the repository at this point in the history
  • Loading branch information
phoenix128 committed Aug 23, 2017
1 parent 27e9b2a commit fffc9a4
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
9 changes: 8 additions & 1 deletion Model/Provider/Engine/U2fKey.php
Original file line number Diff line number Diff line change
Expand Up @@ -198,7 +198,14 @@ protected function getU2f()
/** @var Store $store */
$store = $this->storeManager->getStore(Store::ADMIN_CODE);

$baseUrl = $store->getBaseUrl();
if (preg_match('/^(https?:\/\/.+?)\//', $baseUrl, $matches)) {
$domain = $matches[1];
} else {
throw new LocalizedException(__('Unexpected error while parsing domain name'));
}

/** @var U2F $u2f */
return new U2F(trim($store->getBaseUrl(), '/'));
return new U2F($domain);
}
}
2 changes: 1 addition & 1 deletion etc/module.xml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
-->
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="urn:magento:framework:Module/etc/module.xsd">
<module name="MSP_TwoFactorAuth" setup_version="2.0.3">
<module name="MSP_TwoFactorAuth" setup_version="2.0.4">
<sequence>
<module name="MSP_SecuritySuiteCommon"/>

Expand Down

0 comments on commit fffc9a4

Please sign in to comment.