mirror of
https://github.com/the-djmaze/snappymail.git
synced 2026-11-03 10:58:50 +03:00
parent
4d0ee8736b
commit
f2aba8b11d
3 changed files with 17 additions and 18 deletions
|
|
@ -323,18 +323,20 @@ trait UserAuth
|
|||
{
|
||||
$sSignMeToken = Utils::GetCookie(self::AUTH_SIGN_ME_TOKEN_KEY);
|
||||
if ($sSignMeToken) {
|
||||
\SnappyMail\Log::notice(self::AUTH_SIGN_ME_TOKEN_KEY, 'decrypt');
|
||||
$aResult = \SnappyMail\Crypt::DecryptUrlSafe($sSignMeToken);
|
||||
if (isset($aResult['e'], $aResult['u']) && \SnappyMail\UUID::isValid($aResult['u'])) {
|
||||
return $aResult;
|
||||
}
|
||||
\SnappyMail\Log::notice(self::AUTH_SIGN_ME_TOKEN_KEY, 'invalid');
|
||||
Utils::ClearCookie(self::AUTH_SIGN_ME_TOKEN_KEY);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
private function SetSignMeToken(MainAccount $oAccount): void
|
||||
{
|
||||
// $this->ClearSignMeData();
|
||||
$this->ClearSignMeData();
|
||||
$uuid = \SnappyMail\UUID::generate();
|
||||
$data = \SnappyMail\Crypt::Encrypt($oAccount);
|
||||
Utils::SetCookie(
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue