get seed from otp saved in session
This commit is contained in:
parent
90013b3832
commit
f23bd1339c
@ -37,21 +37,26 @@ class d3_totp_user extends d3_totp_user_parent
|
|||||||
/**
|
/**
|
||||||
* @return d3totp
|
* @return d3totp
|
||||||
*/
|
*/
|
||||||
public function d3getTotp()
|
public function d3getTotp(): d3totp
|
||||||
{
|
{
|
||||||
$totp = oxNew(d3totp::class);
|
return oxNew(d3totp::class);
|
||||||
Registry::getSession()->setVariable(d3totp_conf::OTP_SESSION_VARNAME, $totp);
|
|
||||||
return $totp;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @return Session
|
* @return Session
|
||||||
*/
|
*/
|
||||||
public function d3TotpGetSession()
|
public function d3TotpGetSession(): Session
|
||||||
{
|
{
|
||||||
return Registry::getSession();
|
return Registry::getSession();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function d3getSessionedTotp(): d3totp
|
||||||
|
{
|
||||||
|
$totp = $this->d3getTotp();
|
||||||
|
$this->d3TotpGetSession()->setVariable(d3totp_conf::OTP_SESSION_VARNAME, $totp);
|
||||||
|
return $totp;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @return string|null
|
* @return string|null
|
||||||
*/
|
*/
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
{% include "headitem.html.twig" with {title: "GENERAL_ADMIN_TITLE"|translate} %}
|
{% include "headitem.html.twig" with {title: "GENERAL_ADMIN_TITLE"|translate} %}
|
||||||
{% include "@d3totp/admin/inc/bootstrap.html.twig" %}
|
{% include "@d3totp/admin/inc/bootstrap.html.twig" %}
|
||||||
|
|
||||||
{% set totp = edit.d3GetTotp() %}
|
{% set totp = edit.d3GetSessionedTotp() %}
|
||||||
{% set userid = edit.getId() %}
|
{% set userid = edit.getId() %}
|
||||||
{{ totp.loadByUserId(userid) }}
|
{{ totp.loadByUserId(userid) }}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user