From c4573b02a8ee3f9c4c4007e5311c3e3221969529 Mon Sep 17 00:00:00 2001 From: Nabeel Shahzad Date: Sat, 30 Dec 2017 12:40:36 -0600 Subject: [PATCH] Fix auth header check --- app/Http/Middleware/ApiAuth.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/app/Http/Middleware/ApiAuth.php b/app/Http/Middleware/ApiAuth.php index 06eb361c..3a3082e9 100644 --- a/app/Http/Middleware/ApiAuth.php +++ b/app/Http/Middleware/ApiAuth.php @@ -6,6 +6,7 @@ namespace App\Http\Middleware; use Auth; +use Log; use Closure; use App\Models\User; @@ -21,7 +22,8 @@ class ApiAuth public function handle($request, Closure $next) { // Check if Authorization header is in place - if(!$request->header('Authorization')) { + $auth = $request->header('Authorization', null); + if(empty($auth)) { return $this->unauthorized('Authorization header missing'); }