You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi, I use Laravel with Sanctum, and I've noticed that the app runs a query each time I use request()->user()
I found that if the saved token is incorrect or doesn't exist in the database, the user resolver runs a query each time it is called, and this is not good for performance.
Steps To Reproduce
you can run a fresh Laravel app with sanctum and set wrong token in Bearer token that not exist and use request()->user() for times.
I check app and query log with Clockwork browser extension.
The text was updated successfully, but these errors were encountered:
Laravel Version
10.34.2
PHP Version
8.2.12
Database Driver & Version
8.2.0
Description
sanctum version : 3.3.2
Hi, I use Laravel with Sanctum, and I've noticed that the app runs a query each time I use request()->user()
I found that if the saved token is incorrect or doesn't exist in the database, the user resolver runs a query each time it is called, and this is not good for performance.
Steps To Reproduce
you can run a fresh Laravel app with sanctum and set wrong token in Bearer token that not exist and use request()->user() for times.
I check app and query log with Clockwork browser extension.
The text was updated successfully, but these errors were encountered: