From 152f22d6c380b1bbd3bf56b1a59562db3821ce5c Mon Sep 17 00:00:00 2001 From: Xinecraft Date: Thu, 30 May 2024 23:48:23 +0530 Subject: [PATCH] test --- app/Http/Middleware/AuthenticateApiKey.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/app/Http/Middleware/AuthenticateApiKey.php b/app/Http/Middleware/AuthenticateApiKey.php index 93b0b11c0..d58a95909 100644 --- a/app/Http/Middleware/AuthenticateApiKey.php +++ b/app/Http/Middleware/AuthenticateApiKey.php @@ -7,7 +7,7 @@ use Closure; use Illuminate\Http\Request; -const REQUEST_MAX_AGE_THRESHOLD_SECONDS = 60; // 60 seconds +const REQUEST_MAX_AGE_THRESHOLD_SECONDS = 600; // servers can be out of sync against NTP servers by various minutes so give some buffer . const VALIDATE_SIGNATURE = true; // For testing purposes, we can disable signature validation. class AuthenticateApiKey @@ -73,6 +73,8 @@ public function handle(Request $request, Closure $next) $timestamp = $timestampMs / 1000; $currentTimestamp = now()->timestamp; $requestAge = abs($currentTimestamp - $timestamp); + \Log::info('local timestamp: '.now()->timestamp.' - server timestamp: '.$timestampMs); + \Log::info('Request Age: '.$requestAge); if ($requestAge > REQUEST_MAX_AGE_THRESHOLD_SECONDS) { return response()->json([ 'status' => 'error',