8
0

adjust creating TOTP instance

Dieser Commit ist enthalten in:
Daniel Seifert 2022-09-26 16:07:47 +02:00
Ursprung 337107fe52
Commit 7be2c32cf5
Signiert von: DanielS
GPG-Schlüssel-ID: 8A7C4C6ED1915C6F

Datei anzeigen

@ -145,30 +145,14 @@ class d3totp extends BaseModel
public function getTotp($seed = null)
{
if (false == $this->totp) {
$this->totp = oxNew(
TOTP::class,
$this->getUser()->getFieldData('oxusername')
? $this->getUser()->getFieldData('oxusername')
: null,
$seed
? $seed
: $this->getSavedSecret()
);
$this->totp = TOTP::create($seed ?: $this->getSavedSecret());
$this->totp->setLabel($this->getUser()->getFieldData('oxusername'));
$this->totp->setIssuer(Registry::getConfig()->getActiveShop()->getFieldData('oxname'));
}
return $this->totp;
}
/**
* @return string
*/
public function getQrCodeUri()
{
return $this->getTotp()->getQrCodeUri();
}
/**
* @return string
*/