Skip to content

Commit c5bf6c5

Browse files
authored
Fix broken token relation when auth identifier is not PK (#1835)
1 parent 951fe86 commit c5bf6c5

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/HasApiTokens.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ public function oauthApps(): MorphMany
4747
*/
4848
public function tokens(): HasMany
4949
{
50-
return $this->hasMany(Passport::tokenModel(), 'user_id')
50+
return $this->hasMany(Passport::tokenModel(), 'user_id', $this->getAuthIdentifierName())
5151
->where(function (Builder $query): void {
5252
$query->whereHas('client', function (Builder $query): void {
5353
$query->where(function (Builder $query): void {

0 commit comments

Comments
 (0)