Skip to content

API Tokens from Model with HasApiTokens Trait Incorrectly Recorded as User ID #415

Open
@Sairahcaz

Description

@Sairahcaz

Pulse Version

v1.2.5

Laravel Version

v11.29.0

PHP Version

8.2.12

Livewire Version

v3.5.4

Database Driver & Version

mysql Ver 8.0.39-0ubuntu0.22.04.1 for Linux on x86_64 ((Ubuntu))

Description

Let's say you have a model called Client and it has the HasApiTokens trait.
If you create api tokens for this model and use them to auth/interact with your API, the id of the associated Client is used as the user id for the Application Usage pulse card.

In the screenshot below you can see Syafiq (lets say user id 100) and Aaln (user id 101) are listed, but actually the traffic is made by the api requests with client tokens (client with id 100 and id 101).

Bildschirmfoto 2024-10-23 um 23 06 15

Steps To Reproduce

Create model xyz give it the HasApiToken trait, create a token, interact with your api...

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions