mirror of
https://github.com/the-djmaze/snappymail.git
synced 2026-08-30 20:49:20 +03:00
Bugfix: prevent out-of-memory loop
This commit is contained in:
parent
5719b63619
commit
52e0950734
1 changed files with 6 additions and 5 deletions
|
|
@ -15,8 +15,8 @@ trait UserAuth
|
|||
/**
|
||||
* @var string
|
||||
*/
|
||||
private $oAdditionalAuthAccount = null;
|
||||
private $oMainAuthAccount = null;
|
||||
private $oAdditionalAuthAccount = false;
|
||||
private $oMainAuthAccount = false;
|
||||
|
||||
/**
|
||||
* @throws \RainLoop\Exceptions\ClientException
|
||||
|
|
@ -182,7 +182,7 @@ trait UserAuth
|
|||
{
|
||||
$this->getMainAccountFromToken($bThrowExceptionOnFalse);
|
||||
|
||||
if (\is_null($this->oAdditionalAuthAccount) && isset($_COOKIE[self::AUTH_ADDITIONAL_TOKEN_KEY])) {
|
||||
if (false === $this->oAdditionalAuthAccount && isset($_COOKIE[self::AUTH_ADDITIONAL_TOKEN_KEY])) {
|
||||
$aData = Utils::GetSecureCookie(self::AUTH_ADDITIONAL_TOKEN_KEY);
|
||||
if ($aData) {
|
||||
$this->oAdditionalAuthAccount = AdditionalAccount::NewInstanceFromTokenArray(
|
||||
|
|
@ -192,7 +192,7 @@ trait UserAuth
|
|||
);
|
||||
}
|
||||
if (!$this->oAdditionalAuthAccount) {
|
||||
$this->oAdditionalAuthAccount = false;
|
||||
$this->oAdditionalAuthAccount = null;
|
||||
Utils::ClearCookie(self::AUTH_ADDITIONAL_TOKEN_KEY);
|
||||
}
|
||||
}
|
||||
|
|
@ -205,7 +205,8 @@ trait UserAuth
|
|||
*/
|
||||
public function getMainAccountFromToken(bool $bThrowExceptionOnFalse = true): ?MainAccount
|
||||
{
|
||||
if (!$this->oMainAuthAccount) {
|
||||
if (false === $this->oMainAuthAccount) {
|
||||
$this->oMainAuthAccount = null;
|
||||
if (isset($_COOKIE[self::AUTH_SPEC_LOGOUT_TOKEN_KEY])) {
|
||||
Utils::ClearCookie(self::AUTH_SPEC_LOGOUT_TOKEN_KEY);
|
||||
Utils::ClearCookie(self::AUTH_SIGN_ME_TOKEN_KEY);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue