can add new key and delete existing one

This commit is contained in:
2022-10-26 00:02:55 +02:00
parent b16f55c80d
commit 7752fcf3b0
13 changed files with 555 additions and 128 deletions

View File

@ -17,7 +17,9 @@ namespace D3\Webauthn\Modules\Application\Model;
use D3\Webauthn\Application\Model\d3webauthn;
use D3\Webauthn\Application\Model\d3webauthn_conf;
use OxidEsales\Eshop\Core\Exception\StandardException;
use OxidEsales\Eshop\Core\Registry;
use Webauthn\PublicKeyCredentialUserEntity;
class d3_User_Webauthn extends d3_User_Webauthn_parent
{
@ -60,4 +62,20 @@ class d3_User_Webauthn extends d3_User_Webauthn_parent
{
return oxNew(d3webauthn::class);
}
/**
* @return PublicKeyCredentialUserEntity
*/
public function d3GetWebauthnUserEntity(): PublicKeyCredentialUserEntity
{
if ($this->isLoaded()) {
return oxNew(PublicKeyCredentialUserEntity::class,
$this->getFieldData('oxusername'),
$this->getId(),
$this->getFieldData('oxfname') . ' ' . $this->getFieldData('oxlname')
);
}
throw oxNew(StandardException::class, 'can not create webauthn user entity from not loaded user');
}
}