Update: 2026-07-17 00:15:49

This commit is contained in:
Hamza-Ayed
2026-07-17 00:15:49 +03:00
parent 8cb83b31f2
commit c5ed2099f9
2 changed files with 5 additions and 1 deletions
+3 -1
View File
@@ -29,7 +29,9 @@ const argv = yargs(hideBin(process.argv))
function getMockDriverJwt(driverId) {
try {
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) {
console.error(`Failed to generate JWT for driver ${driverId}`, err.message);
return 'mock_jwt';