diff --git a/src/Middleware/ScopeSessions.php b/src/Middleware/ScopeSessions.php index 46bd5dc4..19081033 100644 --- a/src/Middleware/ScopeSessions.php +++ b/src/Middleware/ScopeSessions.php @@ -19,6 +19,12 @@ class ScopeSessions public function handle(Request $request, Closure $next): mixed { if (! tenancy()->initialized) { + $route = tenancy()->getRoute($request); + + if (tenancy()->routeIsUniversal($route)) { + return $next($request); + } + throw new TenancyNotInitializedException('Tenancy needs to be initialized before the session scoping middleware is executed'); }