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-18 17:45:38Z]: 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: 1c401b28-7ba2-477e-a0d2-f12f74da0800 Correlation ID: 3682fda8-82a8-482b-b1e8-627c365f422b Timestamp: 2026-07-18 17:45:38Z - Correlation ID: 3682fda8-82a8-482b-b1e8-627c365f422b - Trace ID: 1c401b28-7ba2-477e-a0d2-f12f74da0800
(node:1676) [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-18 17:45:38Z]: 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: 5b122f66-1e0b-4926-86af-00d46e380400 Correlation ID: cc29d1b6-79a9-45e4-aab9-df0c82bb2890 Timestamp: 2026-07-18 17:45:38Z - Correlation ID: cc29d1b6-79a9-45e4-aab9-df0c82bb2890 - Trace ID: 5b122f66-1e0b-4926-86af-00d46e380400
Error getting the secret: invalid_client: 7000222 - [2026-07-18 17:45:39Z]: 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: 1c401b28-7ba2-477e-a0d2-f12f7dda0800 Correlation ID: c2b85640-5bbb-454a-bac0-d810fc5c2267 Timestamp: 2026-07-18 17:45:39Z - Correlation ID: c2b85640-5bbb-454a-bac0-d810fc5c2267 - Trace ID: 1c401b28-7ba2-477e-a0d2-f12f7dda0800
Error getting the secret: invalid_client: 7000222 - [2026-07-18 17:45:39Z]: 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: 915e882f-3f1e-4c39-9f4e-25dc00e30800 Correlation ID: 007d9ad0-dc34-4be4-a21f-40b8ecc53cc4 Timestamp: 2026-07-18 17:45:39Z - Correlation ID: 007d9ad0-dc34-4be4-a21f-40b8ecc53cc4 - Trace ID: 915e882f-3f1e-4c39-9f4e-25dc00e30800
Error getting the secret: invalid_client: 7000222 - [2026-07-18 17:45:39Z]: 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: 6b61f40f-eecd-4669-94a0-aef404f10700 Correlation ID: 17c5c230-f272-4e65-9df3-987c4081ec6b Timestamp: 2026-07-18 17:45:39Z - Correlation ID: 17c5c230-f272-4e65-9df3-987c4081ec6b - Trace ID: 6b61f40f-eecd-4669-94a0-aef404f10700
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)