diff --git a/src/Application/Model/Webauthn.php b/src/Application/Model/Webauthn.php index a26f073..4a062f6 100644 --- a/src/Application/Model/Webauthn.php +++ b/src/Application/Model/Webauthn.php @@ -55,6 +55,7 @@ class Webauthn } $e = oxNew(WebauthnException::class, 'D3_WEBAUTHN_ERR_UNSECURECONNECTION'); + Registry::getLogger()->info($e->getDetailedErrorMessage()); Registry::getUtilsView()->addErrorToDisplay($e); return false; diff --git a/src/Application/Model/WebauthnErrors.php b/src/Application/Model/WebauthnErrors.php index 63a8df8..93612a8 100644 --- a/src/Application/Model/WebauthnErrors.php +++ b/src/Application/Model/WebauthnErrors.php @@ -26,6 +26,7 @@ class WebauthnErrors public const NOTSUPPORTED = 'notsupporederror'; public const UNKNOWN = 'unknownerror'; public const NOPUBKEYSUPPORT = 'd3nopublickeycredentialsupportederror'; + public const UNSECURECONNECTION = 'D3_WEBAUTHN_ERR_UNSECURECONNECTION'; /** * @param $msg @@ -54,6 +55,11 @@ class WebauthnErrors return $lang->translateString('D3_WEBAUTHN_ERR_NOPUBKEYSUPPORT', null, true); } + switch ($msg) { + case self::UNSECURECONNECTION: + return $lang->translateString($msg); + } + return $lang->translateString('D3_WEBAUTHN_ERR_TECHNICALERROR', null, true); } @@ -63,6 +69,10 @@ class WebauthnErrors */ public function getErrIdFromMessage(string $msg): string { - return trim(strtolower(substr($msg, 0, strpos($msg, ':')))); + if (is_int(strpos($msg, ':'))) { + return trim( strtolower( substr( $msg, 0, strpos( $msg, ':' ) ) ) ); + } + + return trim(strtolower($msg)); } } \ No newline at end of file