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-17 01:33:46Z]: 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: ba1f5847-c86e-489c-82fa-992c0c9b1a00 Correlation ID: 6362944f-f96b-4cee-a77c-f657d4a628b0 Timestamp: 2026-07-17 01:33:46Z - Correlation ID: 6362944f-f96b-4cee-a77c-f657d4a628b0 - Trace ID: ba1f5847-c86e-489c-82fa-992c0c9b1a00
(node:5020) [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-17 01:33:47Z]: 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: 6479fe0f-663f-4cf6-a7fe-aa749cad4000 Correlation ID: f0b277ed-cddf-4835-8f63-21023e1ad23f Timestamp: 2026-07-17 01:33:47Z - Correlation ID: f0b277ed-cddf-4835-8f63-21023e1ad23f - Trace ID: 6479fe0f-663f-4cf6-a7fe-aa749cad4000
Error getting the secret: invalid_client: 7000222 - [2026-07-17 01:33:47Z]: 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: ba1f5847-c86e-489c-82fa-992c0f9b1a00 Correlation ID: cdba7cc1-5676-4c3c-a57d-147391cb2a97 Timestamp: 2026-07-17 01:33:47Z - Correlation ID: cdba7cc1-5676-4c3c-a57d-147391cb2a97 - Trace ID: ba1f5847-c86e-489c-82fa-992c0f9b1a00
Error getting the secret: invalid_client: 7000222 - [2026-07-17 01:33:47Z]: 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: 6479fe0f-663f-4cf6-a7fe-aa74a5ad4000 Correlation ID: 3279f8e9-37cc-4f98-8a0e-3bf8356824d5 Timestamp: 2026-07-17 01:33:47Z - Correlation ID: 3279f8e9-37cc-4f98-8a0e-3bf8356824d5 - Trace ID: 6479fe0f-663f-4cf6-a7fe-aa74a5ad4000
Error getting the secret: invalid_client: 7000222 - [2026-07-17 01:33:47Z]: 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: 6479fe0f-663f-4cf6-a7fe-aa74abad4000 Correlation ID: 5bcb2d51-8025-44ef-badd-a0afd0c49850 Timestamp: 2026-07-17 01:33:47Z - Correlation ID: 5bcb2d51-8025-44ef-badd-a0afd0c49850 - Trace ID: 6479fe0f-663f-4cf6-a7fe-aa74abad4000
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)