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-15 03:31:10Z]: 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: 0878eb40-f5e1-40b9-86a8-5d8c506f0900 Correlation ID: 900a25f6-979c-48e8-a8e9-26566720258b Timestamp: 2026-07-15 03:31:10Z - Correlation ID: 900a25f6-979c-48e8-a8e9-26566720258b - Trace ID: 0878eb40-f5e1-40b9-86a8-5d8c506f0900
(node:2672) [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-15 03:31:10Z]: 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: f8a2cb66-2ea4-474d-98d6-379bf49e2500 Correlation ID: 5ba1a201-322c-4a9c-9a7d-12859d12694e Timestamp: 2026-07-15 03:31:10Z - Correlation ID: 5ba1a201-322c-4a9c-9a7d-12859d12694e - Trace ID: f8a2cb66-2ea4-474d-98d6-379bf49e2500
Error getting the secret: invalid_client: 7000222 - [2026-07-15 03:31:11Z]: 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: f8a2cb66-2ea4-474d-98d6-379bfe9e2500 Correlation ID: db29c7ae-13bc-4cfe-b378-5d3707421314 Timestamp: 2026-07-15 03:31:11Z - Correlation ID: db29c7ae-13bc-4cfe-b378-5d3707421314 - Trace ID: f8a2cb66-2ea4-474d-98d6-379bfe9e2500
Error getting the secret: invalid_client: 7000222 - [2026-07-15 03:31:11Z]: 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: 58114576-840b-4f14-b24d-401bef2e0800 Correlation ID: 3c8f1d2b-dd79-4925-b2a8-041389ccd43e Timestamp: 2026-07-15 03:31:11Z - Correlation ID: 3c8f1d2b-dd79-4925-b2a8-041389ccd43e - Trace ID: 58114576-840b-4f14-b24d-401bef2e0800
Error getting the secret: invalid_client: 7000222 - [2026-07-15 03:31:11Z]: 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: 791b2c60-d35c-46d0-9224-57fdb5360a00 Correlation ID: af6e178a-0a84-4c2a-beb2-7db343939fdd Timestamp: 2026-07-15 03:31:11Z - Correlation ID: af6e178a-0a84-4c2a-beb2-7db343939fdd - Trace ID: 791b2c60-d35c-46d0-9224-57fdb5360a00
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)