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-08 21:46:32Z]: 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: 555ad8ae-a514-4644-a2e7-4ee58e350700 Correlation ID: f4676a72-afd8-41b9-abc0-61f9867839b6 Timestamp: 2026-07-08 21:46:32Z - Correlation ID: f4676a72-afd8-41b9-abc0-61f9867839b6 - Trace ID: 555ad8ae-a514-4644-a2e7-4ee58e350700
(node:3596) [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-08 21:46:32Z]: 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: 3a876cdf-2236-41ed-bd8a-c3f050310500 Correlation ID: a82446bf-083f-40cf-9c5a-6dacaae6147d Timestamp: 2026-07-08 21:46:32Z - Correlation ID: a82446bf-083f-40cf-9c5a-6dacaae6147d - Trace ID: 3a876cdf-2236-41ed-bd8a-c3f050310500
Error getting the secret: invalid_client: 7000222 - [2026-07-08 21:46:33Z]: 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: 3a876cdf-2236-41ed-bd8a-c3f069310500 Correlation ID: 43bf69c3-2a46-4bb1-abc7-a0166fdced2c Timestamp: 2026-07-08 21:46:33Z - Correlation ID: 43bf69c3-2a46-4bb1-abc7-a0166fdced2c - Trace ID: 3a876cdf-2236-41ed-bd8a-c3f069310500
Error getting the secret: invalid_client: 7000222 - [2026-07-08 21:46:33Z]: 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: 40f6e886-0986-486f-8bd6-b29a5deb6a00 Correlation ID: 00a93fb6-ac3f-41b2-a4ca-adad27a0e590 Timestamp: 2026-07-08 21:46:33Z - Correlation ID: 00a93fb6-ac3f-41b2-a4ca-adad27a0e590 - Trace ID: 40f6e886-0986-486f-8bd6-b29a5deb6a00
Error getting the secret: invalid_client: 7000222 - [2026-07-08 21:46:33Z]: 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: 3a876cdf-2236-41ed-bd8a-c3f074310500 Correlation ID: 85f5cee9-3f7c-4f63-b641-17e7d7ba647b Timestamp: 2026-07-08 21:46:33Z - Correlation ID: 85f5cee9-3f7c-4f63-b641-17e7d7ba647b - Trace ID: 3a876cdf-2236-41ed-bd8a-c3f074310500
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)