WIP: Road to 1.0.0 #1

Draft
miguel456 wants to merge 123 commits from develop into master
Showing only changes of commit 9baa249ba7 - Show all commits

View File

@ -9,6 +9,7 @@ use Closure;
use Illuminate\Http\Request;
use Illuminate\Support\Facades\Hash;
use Illuminate\Support\Facades\Log;
use Illuminate\Support\Facades\Route;
use Illuminate\Support\Str;
class APIAuthenticationMiddleware
@ -34,13 +35,16 @@ class APIAuthenticationMiddleware
if ($keyRecord && Hash::check($loneKey, $keyRecord->secret) && $keyRecord->status == 'active')
{
Log::alert('API Authentication Success', [
'discriminator' => $discriminator
]);
$keyRecord->last_used = Carbon::now();
$keyRecord->save();
Log::info('Recording API call, see context', [
'uri' => $request->url(),
'name' => Route::currentRouteName(),
'discriminator' => $discriminator,
'ip' => $request->ip()
]);
return $next($request);
}