mirror of
https://github.com/snipe/snipe-it.git
synced 2024-12-25 21:54:14 -08:00
d6ead5ae17
* Added health controller * Trying to move session middleware to web and api group to have health controller without session * Fix health route store the session Co-authored-by: Vincent Lainé <v.laine@dental-monitoring.com>
29 lines
550 B
PHP
29 lines
550 B
PHP
<?php
|
|
|
|
namespace App\Http\Middleware;
|
|
|
|
use Closure;
|
|
|
|
class NoSessionStore
|
|
{
|
|
protected $except = [
|
|
'health'
|
|
];
|
|
|
|
/**
|
|
* Handle an incoming request.
|
|
*
|
|
* @param \Illuminate\Http\Request $request
|
|
* @param \Closure $next
|
|
* @return mixed
|
|
*/
|
|
public function handle($request, Closure $next)
|
|
{
|
|
foreach ($this->except as $except) {
|
|
if ($request->is($except)) {
|
|
config()->set('session.driver', 'array');
|
|
}
|
|
}
|
|
return $next($request);
|
|
}
|
|
} |