improve HandleInertiaRequest Middleware
spawn81 opened this issue · 1 comments
spawn81 commented
Hi, first of all, thank you for this awesome package, it's very useful.
I noticed that in the share props of the Middleware, all the user data field are passed. Thinking about the security, I guess that something like that could be very useful for the package:
'auth' => [
'user' => function () use ($request) {
return $request->user() ? $request->user()->only(['email', 'name']) : null;
]
Hope it can be useful.
Cheers
krekas commented
@spawn81 it's laravel breeze code witch we are using. You can check their code here https://github.com/laravel/breeze/blob/1.x/stubs/inertia-common/app/Http/Middleware/HandleInertiaRequests.php#L38