Fix authentication code for daemon requests.
This commit is contained in:
parent
4205213c3c
commit
5651d9ae2b
1 changed files with 13 additions and 0 deletions
|
@ -37,6 +37,15 @@ class DaemonAuthenticate
|
|||
*/
|
||||
protected $auth;
|
||||
|
||||
/**
|
||||
* An array of route names to not apply this middleware to.
|
||||
*
|
||||
* @var array
|
||||
*/
|
||||
protected $except = [
|
||||
'daemon.configuration',
|
||||
];
|
||||
|
||||
/**
|
||||
* Create a new filter instance.
|
||||
*
|
||||
|
@ -57,6 +66,10 @@ class DaemonAuthenticate
|
|||
*/
|
||||
public function handle($request, Closure $next)
|
||||
{
|
||||
if (in_array($request->route()->getName(), $this->except)) {
|
||||
return $next($request);
|
||||
}
|
||||
|
||||
if (! $request->header('X-Access-Node')) {
|
||||
return abort(403);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue