mirror of
https://github.com/archtechx/tenancy.git
synced 2026-02-04 14:44:05 +00:00
Skip ScopeSessions MW if the current context is central and the route is universal
This commit is contained in:
parent
8cd15db1fc
commit
a6df4e526e
1 changed files with 6 additions and 0 deletions
|
|
@ -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');
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue