More encrypt/decrypt improvements to revamp SSO data to be properly encrypted

This commit is contained in:
djmaze 2021-11-10 12:30:56 +01:00
parent cda88f438a
commit 9dae4cfa45
5 changed files with 64 additions and 48 deletions

View file

@ -216,7 +216,7 @@ trait UserAuth
if (empty($sSignMeToken)) {
return null;
}
$aResult = \SnappyMail\Crypt::DecryptCookie($sSignMeToken);
$aResult = \SnappyMail\Crypt::DecryptUrlSafe($sSignMeToken);
return \is_array($aResult) ? $aResult : null;
}
@ -224,7 +224,7 @@ trait UserAuth
{
Utils::SetCookie(
self::AUTH_SIGN_ME_TOKEN_KEY,
\SnappyMail\Crypt::EncryptCookie($aData),
\SnappyMail\Crypt::EncryptUrlSafe($aData),
\time() + 3600 * 24 * 30 // 30 days
);
}