iisnode encountered an error when processing the request.

HRESULT: 0x2
HTTP status: 500
HTTP subStatus: 1002
HTTP reason: Internal Server Error

You are receiving this HTTP 200 response because system.webServer/iisnode/@devErrorsEnabled configuration setting is 'true'.

In addition to the log of stdout and stderr of the node.exe process, consider using debugging and ETW traces to further diagnose the problem.

The last 64k of the output generated by the node.exe process to stderr is shown below:

Error getting the secret: invalid_client: 7000222 - [2026-04-28 10:46:19Z]: AADSTS7000222: The provided client secret keys for app '1a3f705e-321b-477c-a2a9-dd6e240f8c1e' are expired. Visit the Azure portal to create new keys for your app: https://aka.ms/NewClientSecret, or consider using certificate credentials for added security: https://aka.ms/certCreds. Trace ID: 17aebfc2-65f9-49b5-a90b-2845967b0100 Correlation ID: 6d28f246-e94d-48e3-9728-0783e479ff88 Timestamp: 2026-04-28 10:46:19Z - Correlation ID: 6d28f246-e94d-48e3-9728-0783e479ff88 - Trace ID: 17aebfc2-65f9-49b5-a90b-2845967b0100
(node:1136) [DEP0005] DeprecationWarning: Buffer() is deprecated due to security and usability issues. Please use the Buffer.alloc(), Buffer.allocUnsafe(), or Buffer.from() methods instead.
(Use `node --trace-deprecation ...` to show where the warning was created)
Error getting the secret: invalid_client: 7000222 - [2026-04-28 10:46:19Z]: AADSTS7000222: The provided client secret keys for app '1a3f705e-321b-477c-a2a9-dd6e240f8c1e' are expired. Visit the Azure portal to create new keys for your app: https://aka.ms/NewClientSecret, or consider using certificate credentials for added security: https://aka.ms/certCreds. Trace ID: 235e8ac5-03b8-46da-80aa-befffd8a5800 Correlation ID: 30647258-6348-4dd9-b726-d5b6e6a7b944 Timestamp: 2026-04-28 10:46:19Z - Correlation ID: 30647258-6348-4dd9-b726-d5b6e6a7b944 - Trace ID: 235e8ac5-03b8-46da-80aa-befffd8a5800
Error getting the secret: invalid_client: 7000222 - [2026-04-28 10:46:20Z]: AADSTS7000222: The provided client secret keys for app '1a3f705e-321b-477c-a2a9-dd6e240f8c1e' are expired. Visit the Azure portal to create new keys for your app: https://aka.ms/NewClientSecret, or consider using certificate credentials for added security: https://aka.ms/certCreds. Trace ID: 17aebfc2-65f9-49b5-a90b-2845a07b0100 Correlation ID: b8c1a8db-19ff-42a9-8d27-96c9dbd9732c Timestamp: 2026-04-28 10:46:20Z - Correlation ID: b8c1a8db-19ff-42a9-8d27-96c9dbd9732c - Trace ID: 17aebfc2-65f9-49b5-a90b-2845a07b0100
Error getting the secret: invalid_client: 7000222 - [2026-04-28 10:46:20Z]: AADSTS7000222: The provided client secret keys for app '1a3f705e-321b-477c-a2a9-dd6e240f8c1e' are expired. Visit the Azure portal to create new keys for your app: https://aka.ms/NewClientSecret, or consider using certificate credentials for added security: https://aka.ms/certCreds. Trace ID: 385f8665-f7a1-4399-a23a-7a1507595c00 Correlation ID: 61517c66-e773-46d3-ac41-f1c3e117c3b9 Timestamp: 2026-04-28 10:46:20Z - Correlation ID: 61517c66-e773-46d3-ac41-f1c3e117c3b9 - Trace ID: 385f8665-f7a1-4399-a23a-7a1507595c00
Error getting the secret: invalid_client: 7000222 - [2026-04-28 10:46:20Z]: AADSTS7000222: The provided client secret keys for app '1a3f705e-321b-477c-a2a9-dd6e240f8c1e' are expired. Visit the Azure portal to create new keys for your app: https://aka.ms/NewClientSecret, or consider using certificate credentials for added security: https://aka.ms/certCreds. Trace ID: 2f833011-9c18-4be2-85a5-fade14950000 Correlation ID: d42feca0-21f5-4386-8f6a-2ec3f00b1cc3 Timestamp: 2026-04-28 10:46:20Z - Correlation ID: d42feca0-21f5-4386-8f6a-2ec3f00b1cc3 - Trace ID: 2f833011-9c18-4be2-85a5-fade14950000
Application has thrown an uncaught exception and is terminated:
TypeError: Cannot read properties of undefined (reading 'username')
    at C:\vehicle_status_API\server.js:30:32
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)