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-05 11:35: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: b6aabab1-6929-4fd6-be4d-39ed13b61800 Correlation ID: 78a463ae-550a-42e4-9a74-754039466d37 Timestamp: 2026-07-05 11:35:19Z - Correlation ID: 78a463ae-550a-42e4-9a74-754039466d37 - Trace ID: b6aabab1-6929-4fd6-be4d-39ed13b61800
(node:3224) [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-05 11:35: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: 48c0c2dd-2e36-450c-b838-9b397ee22500 Correlation ID: 15e1e11b-4295-4b9a-ab00-a368391fb89d Timestamp: 2026-07-05 11:35:20Z - Correlation ID: 15e1e11b-4295-4b9a-ab00-a368391fb89d - Trace ID: 48c0c2dd-2e36-450c-b838-9b397ee22500
Error getting the secret: invalid_client: 7000222 - [2026-07-05 11:35: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: 252f9ef7-69c6-4100-a17d-4e0793181600 Correlation ID: bbc59cd0-9285-4138-909a-3f5a246b8245 Timestamp: 2026-07-05 11:35:20Z - Correlation ID: bbc59cd0-9285-4138-909a-3f5a246b8245 - Trace ID: 252f9ef7-69c6-4100-a17d-4e0793181600
Error getting the secret: invalid_client: 7000222 - [2026-07-05 11:35: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: 5cc90790-5024-4760-9c6e-9d3710b11700 Correlation ID: 0b670223-b4fb-4880-8047-ee549361b39c Timestamp: 2026-07-05 11:35:20Z - Correlation ID: 0b670223-b4fb-4880-8047-ee549361b39c - Trace ID: 5cc90790-5024-4760-9c6e-9d3710b11700
Error getting the secret: invalid_client: 7000222 - [2026-07-05 11:35:21Z]: 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: 1a98c3b3-b6f0-45b2-9206-706c7d062900 Correlation ID: 5422b638-038a-40a8-8cca-e823b425d390 Timestamp: 2026-07-05 11:35:21Z - Correlation ID: 5422b638-038a-40a8-8cca-e823b425d390 - Trace ID: 1a98c3b3-b6f0-45b2-9206-706c7d062900
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)