Skip to content

Commit 4e4a5c8

Browse files
committed
Fix identitywrapper
1 parent 7d665d9 commit 4e4a5c8

1 file changed

Lines changed: 2 additions & 3 deletions

File tree

yii2-adapter/src/IdentityWrapper.php

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
use CraftCms\Cms\Database\Table;
99
use CraftCms\Cms\Shared\Exceptions\NotSupportedException;
1010
use CraftCms\Cms\Support\Json;
11+
use CraftCms\Cms\Support\Utils;
1112
use CraftCms\Cms\User\Elements\User;
1213
use Illuminate\Support\Facades\DB as DbFacade;
1314
use Throwable;
@@ -18,15 +19,13 @@ class IdentityWrapper extends User implements IdentityInterface
1819
{
1920
public function __construct(User $user)
2021
{
21-
foreach ($user->toArray() as $attribute => $value) {
22+
foreach (Utils::getPublicProperties($user) as $attribute => $value) {
2223
try {
2324
$this->$attribute = $value;
2425
} catch (Throwable) {
2526
// Ignore
2627
}
2728
}
28-
29-
parent::__construct();
3029
}
3130

3231
public static function findIdentity($id): ?self

0 commit comments

Comments
 (0)