Fix authentication code for daemon requests.

This commit is contained in:
Dane Everitt 2017-05-02 20:11:56 -04:00
parent 4205213c3c
commit 5651d9ae2b
No known key found for this signature in database
GPG key ID: EEA66103B3D71F53

View file

@ -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);
}