mirror of
https://github.com/nextcloud/server.git
synced 2026-06-08 16:26:59 -04:00
fix(session): Log when crypto session data is lost
Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
This commit is contained in:
parent
436759f317
commit
db8252e82c
1 changed files with 7 additions and 1 deletions
|
|
@ -32,6 +32,7 @@ namespace OC\Session;
|
|||
use OCP\ISession;
|
||||
use OCP\Security\ICrypto;
|
||||
use OCP\Session\Exceptions\SessionNotAvailableException;
|
||||
use function OCP\Log\logger;
|
||||
|
||||
/**
|
||||
* Class CryptoSessionData
|
||||
|
|
@ -82,9 +83,14 @@ class CryptoSessionData implements \ArrayAccess, ISession {
|
|||
try {
|
||||
$this->sessionValues = json_decode(
|
||||
$this->crypto->decrypt($encryptedSessionData, $this->passphrase),
|
||||
true
|
||||
true,
|
||||
512,
|
||||
JSON_THROW_ON_ERROR,
|
||||
);
|
||||
} catch (\Exception $e) {
|
||||
logger('core')->critical('Could not decrypt or decode encrypted session data', [
|
||||
'exception' => $e,
|
||||
]);
|
||||
$this->sessionValues = [];
|
||||
$this->regenerateId(true, false);
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue