mirror of
https://github.com/the-djmaze/snappymail.git
synced 2026-07-13 03:27:39 +03:00
Ask for TFA again after logging out (#123)
This commit is contained in:
parent
fa8d7e5ebe
commit
01a1bbf8f1
7 changed files with 218 additions and 208 deletions
|
|
@ -1455,7 +1455,7 @@ class Actions
|
||||||
|
|
||||||
if ($bAdditionalCodeSignMeSignMe)
|
if ($bAdditionalCodeSignMeSignMe)
|
||||||
{
|
{
|
||||||
$this->setSkipTimeoutForTwoFactor($oAccount->ParentEmailHelper());
|
$this->setSkipTimeoutForTwoFactor($oAccount->ParentEmailHelper(), \time());
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!$bGood && !$this->TwoFactorAuthProvider()->VerifyCode($aData['Secret'], $sAdditionalCode))
|
if (!$bGood && !$this->TwoFactorAuthProvider()->VerifyCode($aData['Secret'], $sAdditionalCode))
|
||||||
|
|
@ -1907,6 +1907,15 @@ class Actions
|
||||||
'SignMe/UserToken/'.$oAccount->SignMeToken());
|
'SignMe/UserToken/'.$oAccount->SignMeToken());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if ($oAccount && $this->TwoFactorAuthProvider()->IsActive())
|
||||||
|
{
|
||||||
|
$aData = $this->getTwoFactorInfo($oAccount->ParentEmailHelper());
|
||||||
|
if (\is_array($aData) && isset($aData['IsSet'], $aData['Enable']))
|
||||||
|
{
|
||||||
|
$this->setSkipTimeoutForTwoFactor($oAccount->ParentEmailHelper(), 0);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
return $this->TrueResponse(__FUNCTION__);
|
return $this->TrueResponse(__FUNCTION__);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -4741,10 +4750,11 @@ class Actions
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param string $sEmail
|
* @param string $sEmail
|
||||||
|
* @param int $iTime = 0
|
||||||
*
|
*
|
||||||
* @return bool
|
* @return bool
|
||||||
*/
|
*/
|
||||||
private function setSkipTimeoutForTwoFactor($sEmail)
|
private function setSkipTimeoutForTwoFactor($sEmail, $iTime = 0)
|
||||||
{
|
{
|
||||||
if (empty($sEmail))
|
if (empty($sEmail))
|
||||||
{
|
{
|
||||||
|
|
@ -4761,7 +4771,7 @@ class Actions
|
||||||
$mData = \RainLoop\Utils::DecodeKeyValues($sData);
|
$mData = \RainLoop\Utils::DecodeKeyValues($sData);
|
||||||
if (\is_array($mData))
|
if (\is_array($mData))
|
||||||
{
|
{
|
||||||
$mData['Timeout'] = \time();
|
$mData['Timeout'] = 0 < $iTime ? $iTime : 0;
|
||||||
|
|
||||||
return $this->StorageProvider()->Put(null,
|
return $this->StorageProvider()->Put(null,
|
||||||
\RainLoop\Providers\Storage\Enumerations\StorageType::NOBODY,
|
\RainLoop\Providers\Storage\Enumerations\StorageType::NOBODY,
|
||||||
|
|
|
||||||
6
rainloop/v/0.0.0/static/js/admin.min.js
vendored
6
rainloop/v/0.0.0/static/js/admin.min.js
vendored
File diff suppressed because one or more lines are too long
14
rainloop/v/0.0.0/static/js/app.min.js
vendored
14
rainloop/v/0.0.0/static/js/app.min.js
vendored
File diff suppressed because one or more lines are too long
Loading…
Add table
Add a link
Reference in a new issue