Subject of the issue
I've migrated my environment to Octane+Swoole and when making a request with jwt.auth middleware in api.php, the user is found using Auth::user() or $request->user(), but the subsequent request return null.
Your environment:
| Q |
A |
| Bug? |
yes |
| New Feature? |
no |
| Framework |
Laravel |
| Framework version |
9.52.9 |
| Package version |
2.1.0 |
| PHP version |
8.1.20 |
Steps to reproduce
dd(Auth::user()) in a controller API request twice in a row. Running php artisan octane:reload fixes the issue for the next request only.
Expected behaviour
Auth::user() should return the user object on every request, not just the first one.
Actual behaviour
Auth::user() returns a user on the first request, then null on any requests after that.
Subject of the issue
I've migrated my environment to Octane+Swoole and when making a request with
jwt.authmiddleware inapi.php, the user is found usingAuth::user()or$request->user(), but the subsequent request returnnull.Your environment:
Steps to reproduce
dd(Auth::user())in a controller API request twice in a row. Runningphp artisan octane:reloadfixes the issue for the next request only.Expected behaviour
Auth::user()should return the user object on every request, not just the first one.Actual behaviour
Auth::user()returns a user on the first request, then null on any requests after that.