From bfdb6454d830e91414aa503e93d34ff2495c7b1b Mon Sep 17 00:00:00 2001 From: Daniel Seifert Date: Thu, 3 Nov 2022 13:43:39 +0100 Subject: [PATCH] make relying party URL configurable --- src/Application/Model/RelyingPartyEntity.php | 6 +++++- src/metadata.php | 8 ++++++++ 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/src/Application/Model/RelyingPartyEntity.php b/src/Application/Model/RelyingPartyEntity.php index bc1aef3..c81f967 100755 --- a/src/Application/Model/RelyingPartyEntity.php +++ b/src/Application/Model/RelyingPartyEntity.php @@ -26,9 +26,13 @@ class RelyingPartyEntity extends PublicKeyCredentialRpEntity { public function __construct() { + $shopUrl = is_string(Registry::getConfig()->getConfigParam('d3webauthn_diffshopurl')) ? + trim(Registry::getConfig()->getConfigParam('d3webauthn_diffshopurl')) : + null; + parent::__construct( Registry::getConfig()->getActiveShop()->getFieldData('oxname'), - preg_replace('/(^www\.)(.*)/mi', '$2', $_SERVER['HTTP_HOST']) + $shopUrl ?: preg_replace('/(^www\.)(.*)/mi', '$2', $_SERVER['HTTP_HOST']) ); } } \ No newline at end of file diff --git a/src/metadata.php b/src/metadata.php index 911578b..7185325 100755 --- a/src/metadata.php +++ b/src/metadata.php @@ -146,5 +146,13 @@ $aModule = array( 'block' => 'checkout_options_login', 'file' => 'Application/views/blocks/page/checkout/inc/checkout_options_login.tpl', ] + ], + 'settings' => [ + [ + 'group' => $sModuleId.'_general', + 'name' => $sModuleId.'_diffshopurl', + 'type' => 'str', + 'value' => false + ], ] ); \ No newline at end of file