Allplmpliedl manual JWT check and restored all driver fields68j2
This commit is contained in:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user