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-06-17 13:18:02Z]: 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: ce0b352c-a96a-438c-9896-576cf29b5c00 Correlation ID: 3e26c3b2-9971-4aca-a1c6-e94e96423861 Timestamp: 2026-06-17 13:18:02Z - Correlation ID: 3e26c3b2-9971-4aca-a1c6-e94e96423861 - Trace ID: ce0b352c-a96a-438c-9896-576cf29b5c00
(node:7052) [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-06-17 13:18:02Z]: 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: 4659228d-723f-4a25-b759-0217b74f7600 Correlation ID: 82f6fbe1-6387-49ec-9061-db53dd746091 Timestamp: 2026-06-17 13:18:02Z - Correlation ID: 82f6fbe1-6387-49ec-9061-db53dd746091 - Trace ID: 4659228d-723f-4a25-b759-0217b74f7600
Error getting the secret: invalid_client: 7000222 - [2026-06-17 13:18:02Z]: 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: 2dbd992a-9943-4b58-a7db-b60abdf84e00 Correlation ID: 987f6d59-03c0-4198-ae59-9824c7c3571e Timestamp: 2026-06-17 13:18:02Z - Correlation ID: 987f6d59-03c0-4198-ae59-9824c7c3571e - Trace ID: 2dbd992a-9943-4b58-a7db-b60abdf84e00
Error getting the secret: invalid_client: 7000222 - [2026-06-17 13:18:02Z]: 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: ce0b352c-a96a-438c-9896-576c089c5c00 Correlation ID: 0edc2288-9027-47da-9b89-387cc80f172a Timestamp: 2026-06-17 13:18:02Z - Correlation ID: 0edc2288-9027-47da-9b89-387cc80f172a - Trace ID: ce0b352c-a96a-438c-9896-576c089c5c00
Application has thrown an uncaught exception and is terminated:
TypeError: Cannot read properties of undefined (reading 'username')
    at C:\vehicle_status_API\server.js:25:32
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)