Skip to content

Commit 82c890b

Browse files
Merge branch '6.0' into 6.1
* 6.0: [Security] fix compat with older session payloads Fix transient test Fix transient test
2 parents 74b15ad + 26dd796 commit 82c890b

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

Authentication/Token/AbstractToken.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
namespace Symfony\Component\Security\Core\Authentication\Token;
1313

1414
use Symfony\Component\Security\Core\User\UserInterface;
15+
use Symfony\Component\Security\Core\User\InMemoryUser;
1516

1617
/**
1718
* Base class for Token instances.
@@ -114,7 +115,8 @@ public function __serialize(): array
114115
*/
115116
public function __unserialize(array $data): void
116117
{
117-
[$this->user, , , $this->attributes, $this->roleNames] = $data;
118+
[$user, , , $this->attributes, $this->roleNames] = $data;
119+
$this->user = \is_string($user) ? new InMemoryUser($user, '', $this->roleNames) : $user;
118120
}
119121

120122
/**

0 commit comments

Comments
 (0)