From 5651d9ae2b25f7c1a23f59b238fe0eef49081f59 Mon Sep 17 00:00:00 2001 From: Dane Everitt Date: Tue, 2 May 2017 20:11:56 -0400 Subject: [PATCH] Fix authentication code for daemon requests. --- app/Http/Middleware/DaemonAuthenticate.php | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/app/Http/Middleware/DaemonAuthenticate.php b/app/Http/Middleware/DaemonAuthenticate.php index 8b1813185..8e9e44924 100644 --- a/app/Http/Middleware/DaemonAuthenticate.php +++ b/app/Http/Middleware/DaemonAuthenticate.php @@ -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); }