show unsecure message in myAccount, if shop is not in https

This commit is contained in:
Daniel Seifert 2022-11-09 11:19:53 +01:00
parent f8a755dc6f
commit 8fccae9412
Signed by: DanielS
GPG Key ID: 8A7C4C6ED1915C6F
2 changed files with 12 additions and 1 deletions

View File

@ -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;

View File

@ -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
{
if (is_int(strpos($msg, ':'))) {
return trim( strtolower( substr( $msg, 0, strpos( $msg, ':' ) ) ) );
}
return trim(strtolower($msg));
}
}