mirror of
https://github.com/the-djmaze/snappymail.git
synced 2026-09-09 17:37:02 +03:00
Resolve #1241
This commit is contained in:
parent
26b7abf893
commit
edad4ac025
4 changed files with 11 additions and 10 deletions
|
|
@ -294,9 +294,6 @@ trait UserAuth
|
|||
{
|
||||
$this->oAdditionalAuthAccount = false;
|
||||
$this->oMainAuthAccount = $oAccount;
|
||||
if (!isset($_COOKIE['smctoken'])) {
|
||||
Cookies::set('smctoken', \base64_encode(\random_bytes(16)), 0, false);
|
||||
}
|
||||
static::SetAccountCookie(self::AUTH_SPEC_TOKEN_KEY, $oAccount);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -41,13 +41,14 @@ abstract class Crypt
|
|||
}
|
||||
|
||||
/**
|
||||
* When $key is empty, it will use a fingerprint of the user agent.
|
||||
* When $key is empty, it will use the smctoken.
|
||||
*/
|
||||
private static function Passphrase(?string $key) : string
|
||||
{
|
||||
if (!$key) {
|
||||
if (empty($_COOKIE['smctoken'])) {
|
||||
throw new \RuntimeException('Missing smctoken');
|
||||
\SnappyMail\Cookies::set('smctoken', \base64_encode(\random_bytes(16)), 0, false);
|
||||
// throw new \RuntimeException('Missing smctoken');
|
||||
}
|
||||
$key = $_COOKIE['smctoken'] . APP_VERSION;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue