From 2fca28993e805462535cc42d3681dae19ae1e505 Mon Sep 17 00:00:00 2001 From: Nabeel Shahzad Date: Mon, 11 Dec 2017 22:10:48 -0600 Subject: [PATCH] don't cache for now #36 --- app/Http/Middleware/ApiAuth.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/app/Http/Middleware/ApiAuth.php b/app/Http/Middleware/ApiAuth.php index 8809b025..8aed6081 100644 --- a/app/Http/Middleware/ApiAuth.php +++ b/app/Http/Middleware/ApiAuth.php @@ -28,13 +28,14 @@ class ApiAuth // Try to find the user via API key. Cache this lookup $api_key = $request->header('Authorization'); - $user = Cache::remember( + $user = User::where('apikey', $api_key)->first(); + /*$user = Cache::remember( config('cache.keys.USER_API_KEY.key') . $api_key, config('cache.keys.USER_API_KEY.time'), function () use ($api_key) { return User::where('apikey', $api_key)->first(); } - ); + );*/ if(!$user) { return $this->unauthorized();