Skip to content

Commit

Permalink
Fix where clause when fetching user
Browse files Browse the repository at this point in the history
- When fetching a user, "id" was being used instead of ID_KEY. This leads to problems if the user database has a different column name for id
  • Loading branch information
crosa7 committed May 19, 2023
1 parent f293438 commit 022448e
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/Auth.php
Original file line number Diff line number Diff line change
Expand Up @@ -454,7 +454,7 @@ public static function user(array $hidden = [])
return null;
}

$user = static::$db->select($table)->where('id', static::id())->fetchAssoc();
$user = static::$db->select($table)->where(static::$settings['ID_KEY'], static::id())->fetchAssoc();

if (count($hidden) > 0) {
foreach ($hidden as $item) {
Expand Down

0 comments on commit 022448e

Please sign in to comment.