mirror of
https://github.com/the-djmaze/snappymail.git
synced 2026-09-08 00:47:04 +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
|
* @var string
|
||||||
*/
|
*/
|
||||||
private $oAdditionalAuthAccount = null;
|
private $oAdditionalAuthAccount = false;
|
||||||
private $oMainAuthAccount = null;
|
private $oMainAuthAccount = false;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @throws \RainLoop\Exceptions\ClientException
|
* @throws \RainLoop\Exceptions\ClientException
|
||||||
|
|
@ -182,7 +182,7 @@ trait UserAuth
|
||||||
{
|
{
|
||||||
$this->getMainAccountFromToken($bThrowExceptionOnFalse);
|
$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);
|
$aData = Utils::GetSecureCookie(self::AUTH_ADDITIONAL_TOKEN_KEY);
|
||||||
if ($aData) {
|
if ($aData) {
|
||||||
$this->oAdditionalAuthAccount = AdditionalAccount::NewInstanceFromTokenArray(
|
$this->oAdditionalAuthAccount = AdditionalAccount::NewInstanceFromTokenArray(
|
||||||
|
|
@ -192,7 +192,7 @@ trait UserAuth
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
if (!$this->oAdditionalAuthAccount) {
|
if (!$this->oAdditionalAuthAccount) {
|
||||||
$this->oAdditionalAuthAccount = false;
|
$this->oAdditionalAuthAccount = null;
|
||||||
Utils::ClearCookie(self::AUTH_ADDITIONAL_TOKEN_KEY);
|
Utils::ClearCookie(self::AUTH_ADDITIONAL_TOKEN_KEY);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -205,7 +205,8 @@ trait UserAuth
|
||||||
*/
|
*/
|
||||||
public function getMainAccountFromToken(bool $bThrowExceptionOnFalse = true): ?MainAccount
|
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])) {
|
if (isset($_COOKIE[self::AUTH_SPEC_LOGOUT_TOKEN_KEY])) {
|
||||||
Utils::ClearCookie(self::AUTH_SPEC_LOGOUT_TOKEN_KEY);
|
Utils::ClearCookie(self::AUTH_SPEC_LOGOUT_TOKEN_KEY);
|
||||||
Utils::ClearCookie(self::AUTH_SIGN_ME_TOKEN_KEY);
|
Utils::ClearCookie(self::AUTH_SIGN_ME_TOKEN_KEY);
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue