Skip to content

Commit 4892810

Browse files
committed
fix: patch up id.key returning null
1 parent d11bb0d commit 4892810

2 files changed

Lines changed: 3 additions & 3 deletions

File tree

src/Auth/User.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ public function __construct($data, $session = true)
9797
*/
9898
public function id()
9999
{
100-
return $this->data['id'] ?? null;
100+
return $this->data[Config::get('id.key')] ?? null;
101101
}
102102

103103
/**

src/Auth/UsesRoles.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ public function assign($role): bool
4444
->params([
4545
$roleKey => json_encode($this->roles)
4646
])
47-
->where(Config::get('id.key'), $this->data['id'])
47+
->where(Config::get('id.key'), $this->data[Config::get('id.key')])
4848
->execute();
4949
} catch (\Throwable $th) {
5050
return false;
@@ -133,7 +133,7 @@ public function unassign($role): void
133133
->params([
134134
Config::get('roles.key') => json_encode($this->roles)
135135
])
136-
->where(Config::get('id.key'), $this->data['id'])
136+
->where(Config::get('id.key'), $this->data[Config::get('id.key')])
137137
->execute();
138138
}
139139

0 commit comments

Comments
 (0)