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-10-02 19:24:16Z]: 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: d5195e30-3bfc-4803-8712-776ec8b23000 Correlation ID: 0594a024-309b-4272-aa32-9c1fc5524ebd Timestamp: 2026-10-02 19:24:16Z - Correlation ID: 0594a024-309b-4272-aa32-9c1fc5524ebd - Trace ID: d5195e30-3bfc-4803-8712-776ec8b23000
(node:6092) [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-10-02 19:24:16Z]: 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: 022c7a3f-b881-4525-9b0d-7a6155fdb100 Correlation ID: b1e6a6ef-8e10-42c4-8ec0-c387dc95ecea Timestamp: 2026-10-02 19:24:16Z - Correlation ID: b1e6a6ef-8e10-42c4-8ec0-c387dc95ecea - Trace ID: 022c7a3f-b881-4525-9b0d-7a6155fdb100
Error getting the secret: invalid_client: 7000222 - [2026-10-02 19:24:17Z]: 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: b890b151-a3b4-40f0-9313-668799946e00 Correlation ID: a9c4b2e8-86ad-4fda-85cd-b65b667d030f Timestamp: 2026-10-02 19:24:17Z - Correlation ID: a9c4b2e8-86ad-4fda-85cd-b65b667d030f - Trace ID: b890b151-a3b4-40f0-9313-668799946e00
Error getting the secret: invalid_client: 7000222 - [2026-10-02 19:24:17Z]: 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: 79eefb78-e9d5-4f3e-8c89-30c410a65e00 Correlation ID: e8a44d8c-a518-492e-88e9-a73a552cb8ef Timestamp: 2026-10-02 19:24:17Z - Correlation ID: e8a44d8c-a518-492e-88e9-a73a552cb8ef - Trace ID: 79eefb78-e9d5-4f3e-8c89-30c410a65e00
Error getting the secret: invalid_client: 7000222 - [2026-10-02 19:24:17Z]: 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: d0721e4a-b9e6-4f9c-8b21-2f447b536900 Correlation ID: d6a4ead4-2e06-41b7-9b92-3dbde09178bd Timestamp: 2026-10-02 19:24:17Z - Correlation ID: d6a4ead4-2e06-41b7-9b92-3dbde09178bd - Trace ID: d0721e4a-b9e6-4f9c-8b21-2f447b536900
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)