forked from D3Public/oxtotp
adjust creating TOTP instance
This commit is contained in:
parent
337107fe52
commit
7be2c32cf5
@ -145,30 +145,14 @@ class d3totp extends BaseModel
|
|||||||
public function getTotp($seed = null)
|
public function getTotp($seed = null)
|
||||||
{
|
{
|
||||||
if (false == $this->totp) {
|
if (false == $this->totp) {
|
||||||
|
$this->totp = TOTP::create($seed ?: $this->getSavedSecret());
|
||||||
$this->totp = oxNew(
|
$this->totp->setLabel($this->getUser()->getFieldData('oxusername'));
|
||||||
TOTP::class,
|
|
||||||
$this->getUser()->getFieldData('oxusername')
|
|
||||||
? $this->getUser()->getFieldData('oxusername')
|
|
||||||
: null,
|
|
||||||
$seed
|
|
||||||
? $seed
|
|
||||||
: $this->getSavedSecret()
|
|
||||||
);
|
|
||||||
$this->totp->setIssuer(Registry::getConfig()->getActiveShop()->getFieldData('oxname'));
|
$this->totp->setIssuer(Registry::getConfig()->getActiveShop()->getFieldData('oxname'));
|
||||||
}
|
}
|
||||||
|
|
||||||
return $this->totp;
|
return $this->totp;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* @return string
|
|
||||||
*/
|
|
||||||
public function getQrCodeUri()
|
|
||||||
{
|
|
||||||
return $this->getTotp()->getQrCodeUri();
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @return string
|
* @return string
|
||||||
*/
|
*/
|
||||||
|
Loading…
Reference in New Issue
Block a user