Update: 2026-07-17 00:15:49
This commit is contained in:
@@ -1,4 +1,6 @@
|
|||||||
<?php
|
<?php
|
||||||
|
error_reporting(0);
|
||||||
|
ini_set('display_errors', 0);
|
||||||
// stress_test/generate_mock_data.php
|
// stress_test/generate_mock_data.php
|
||||||
// Generates a valid JWT for the driver using the system's JWT_SECRET_KEY
|
// Generates a valid JWT for the driver using the system's JWT_SECRET_KEY
|
||||||
require_once dirname(__DIR__) . '/backend/connect.php';
|
require_once dirname(__DIR__) . '/backend/connect.php';
|
||||||
|
|||||||
@@ -29,7 +29,9 @@ const argv = yargs(hideBin(process.argv))
|
|||||||
function getMockDriverJwt(driverId) {
|
function getMockDriverJwt(driverId) {
|
||||||
try {
|
try {
|
||||||
const output = execSync(`php generate_mock_data.php ${driverId}`).toString();
|
const output = execSync(`php generate_mock_data.php ${driverId}`).toString();
|
||||||
return JSON.parse(output).jwt;
|
// Extract JSON portion in case of PHP warnings
|
||||||
|
const jsonString = output.substring(output.indexOf('{'));
|
||||||
|
return JSON.parse(jsonString).jwt;
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
console.error(`Failed to generate JWT for driver ${driverId}`, err.message);
|
console.error(`Failed to generate JWT for driver ${driverId}`, err.message);
|
||||||
return 'mock_jwt';
|
return 'mock_jwt';
|
||||||
|
|||||||
Reference in New Issue
Block a user