mirror of
https://github.com/archtechx/tenancy.git
synced 2026-02-05 04:54:03 +00:00
bug: added null check on middleware onFail in UniversalRoutes
This commit is contained in:
parent
4dab0c1870
commit
89be25a3af
1 changed files with 8 additions and 6 deletions
|
|
@ -23,13 +23,15 @@ class UniversalRoutes implements Feature
|
||||||
public function bootstrap(Tenancy $tenancy): void
|
public function bootstrap(Tenancy $tenancy): void
|
||||||
{
|
{
|
||||||
foreach (static::$identificationMiddlewares as $middleware) {
|
foreach (static::$identificationMiddlewares as $middleware) {
|
||||||
$middleware::$onFail = function ($exception, $request, $next) {
|
if (is_null($middleware::$onFail)) {
|
||||||
if (static::routeHasMiddleware($request->route(), static::$middlewareGroup)) {
|
$middleware::$onFail = function ($exception, $request, $next) {
|
||||||
return $next($request);
|
if (static::routeHasMiddleware($request->route(), static::$middlewareGroup)) {
|
||||||
}
|
return $next($request);
|
||||||
|
}
|
||||||
|
|
||||||
throw $exception;
|
throw $exception;
|
||||||
};
|
};
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue