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-14 17:22:45Z]: 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: 3a239bbc-e8f6-430e-982c-db850e383d00 Correlation ID: 50fd16ca-765e-495b-adce-9fe12000c4c2 Timestamp: 2026-07-14 17:22:45Z - Correlation ID: 50fd16ca-765e-495b-adce-9fe12000c4c2 - Trace ID: 3a239bbc-e8f6-430e-982c-db850e383d00
(node:2732) [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-14 17:22:45Z]: 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: 936e49c6-b4f4-4bcd-b612-e22e0a1e4400 Correlation ID: 35da3305-4063-48c1-afa9-2e959cafa99f Timestamp: 2026-07-14 17:22:45Z - Correlation ID: 35da3305-4063-48c1-afa9-2e959cafa99f - Trace ID: 936e49c6-b4f4-4bcd-b612-e22e0a1e4400
Error getting the secret: invalid_client: 7000222 - [2026-07-14 17:22: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: 936e49c6-b4f4-4bcd-b612-e22e141e4400 Correlation ID: a53f3429-4405-413d-916c-bf8c99d8ad9b Timestamp: 2026-07-14 17:22:46Z - Correlation ID: a53f3429-4405-413d-916c-bf8c99d8ad9b - Trace ID: 936e49c6-b4f4-4bcd-b612-e22e141e4400
Error getting the secret: invalid_client: 7000222 - [2026-07-14 17:22: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: 244c5cfe-59ba-4f44-96cc-dfc69c5e1000 Correlation ID: b36dd339-d25e-43af-9097-ddabed654c7f Timestamp: 2026-07-14 17:22:46Z - Correlation ID: b36dd339-d25e-43af-9097-ddabed654c7f - Trace ID: 244c5cfe-59ba-4f44-96cc-dfc69c5e1000
Error getting the secret: invalid_client: 7000222 - [2026-07-14 17:22: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: e678b1d1-66f9-4dbb-ba29-758d41a13700 Correlation ID: aab9f5bd-86a5-470d-9722-086cf1213f4f Timestamp: 2026-07-14 17:22:46Z - Correlation ID: aab9f5bd-86a5-470d-9722-086cf1213f4f - Trace ID: e678b1d1-66f9-4dbb-ba29-758d41a13700
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)