Skip to content

Commit 29006c2

Browse files
ddeboerfabpot
authored andcommitted
Fix parent serialization of user object
1 parent 8b2525c commit 29006c2

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

Authentication/Token/AbstractToken.php

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -146,7 +146,14 @@ public function eraseCredentials()
146146
*/
147147
public function serialize()
148148
{
149-
return serialize(array($this->user, $this->authenticated, $this->roles, $this->attributes));
149+
return serialize(
150+
array(
151+
is_object($this->user) ? clone $this->user : $this->user,
152+
$this->authenticated,
153+
$this->roles,
154+
$this->attributes
155+
)
156+
);
150157
}
151158

152159
/**

0 commit comments

Comments
 (0)