Allplmpliedl manual JWT check and restored all driver fields68j2

This commit is contained in:
Hamza-Ayed
2026-04-25 21:28:42 +03:00
parent fca292f2a4
commit fadb373d42
6 changed files with 119 additions and 19 deletions

View File

@@ -81,10 +81,16 @@ class HmacAuthMiddleware
}
// Compute expected signature
// METHOD:PATH:TIMESTAMP:NONCE:BODY
$method = strtoupper($request->method());
$path = $request->path(); // returns path without leading slash (e.g. v2/ride/create)
$body = $request->getContent();
if (str_contains(strtolower($request->header('Content-Type', '')), 'multipart/form-data')) {
$inputs = $request->except(array_keys($request->allFiles()));
ksort($inputs);
$body = json_encode($inputs);
} else {
$body = $request->getContent();
}
$payload = "$method:$path:$timestamp:$nonce:$body";
$expected = hash_hmac(self::ALGORITHM, $payload, $user->api_secret);