From 2a4046a103446dda8eb627e322d1137190115f8a Mon Sep 17 00:00:00 2001 From: Miguel Piedrafita Date: Fri, 4 Sep 2020 05:06:33 +0200 Subject: [PATCH] Allow using Inertia without a session --- src/Http/Middleware/ShareInertiaData.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/Http/Middleware/ShareInertiaData.php b/src/Http/Middleware/ShareInertiaData.php index 13d29942c..04eecc1c2 100644 --- a/src/Http/Middleware/ShareInertiaData.php +++ b/src/Http/Middleware/ShareInertiaData.php @@ -30,6 +30,10 @@ public function handle($request, $next) ]; }, 'user' => function () use ($request) { + if (! $request->user()) { + return; + } + if (Jetstream::hasTeamFeatures() && $request->user()) { $request->user()->currentTeam; }