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-07-19 23:33:27Z]: 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: 8c0ec5f5-dabf-4dfb-bf26-0bb6f9b21b00 Correlation ID: 8877d162-e739-4269-981f-abb7d132ccb6 Timestamp: 2026-07-19 23:33:27Z - Correlation ID: 8877d162-e739-4269-981f-abb7d132ccb6 - Trace ID: 8c0ec5f5-dabf-4dfb-bf26-0bb6f9b21b00
(node:804) [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-07-19 23:33:27Z]: 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: 222066c4-d641-49f2-b53c-62ebd6451900 Correlation ID: 2480fecb-9138-46c3-81a1-3118155e279a Timestamp: 2026-07-19 23:33:27Z - Correlation ID: 2480fecb-9138-46c3-81a1-3118155e279a - Trace ID: 222066c4-d641-49f2-b53c-62ebd6451900
Error getting the secret: invalid_client: 7000222 - [2026-07-19 23:33:27Z]: 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: d1323e46-b828-4592-967d-c96630515500 Correlation ID: 34cf257e-7830-40f9-aa77-0e9383f76b75 Timestamp: 2026-07-19 23:33:27Z - Correlation ID: 34cf257e-7830-40f9-aa77-0e9383f76b75 - Trace ID: d1323e46-b828-4592-967d-c96630515500
Error getting the secret: invalid_client: 7000222 - [2026-07-19 23:33:27Z]: 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: 75b73842-7865-4bc2-88ae-06e438b01d00 Correlation ID: b999382c-27a9-496a-9db2-3a47ee5ccc03 Timestamp: 2026-07-19 23:33:27Z - Correlation ID: b999382c-27a9-496a-9db2-3a47ee5ccc03 - Trace ID: 75b73842-7865-4bc2-88ae-06e438b01d00
Error getting the secret: invalid_client: 7000222 - [2026-07-19 23:33:27Z]: 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: d41169b1-2f3b-4214-b94f-8eec37b01b00 Correlation ID: 40a351be-3653-4f43-967a-1230740d6aa5 Timestamp: 2026-07-19 23:33:27Z - Correlation ID: 40a351be-3653-4f43-967a-1230740d6aa5 - Trace ID: d41169b1-2f3b-4214-b94f-8eec37b01b00
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)