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-13 00:22:58Z]: 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: b94518f7-5548-4901-a2e2-9d1401041400 Correlation ID: 227fc386-8fcc-4693-8bd1-cded208670a3 Timestamp: 2026-07-13 00:22:58Z - Correlation ID: 227fc386-8fcc-4693-8bd1-cded208670a3 - Trace ID: b94518f7-5548-4901-a2e2-9d1401041400
(node:5680) [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-13 00:22:58Z]: 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: 1c24ea67-2fd8-4678-a444-611c861b1400 Correlation ID: 7e7a5fc1-a1c3-44d1-a1fa-92e8597d0760 Timestamp: 2026-07-13 00:22:58Z - Correlation ID: 7e7a5fc1-a1c3-44d1-a1fa-92e8597d0760 - Trace ID: 1c24ea67-2fd8-4678-a444-611c861b1400
Error getting the secret: invalid_client: 7000222 - [2026-07-13 00:22:59Z]: 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: b94518f7-5548-4901-a2e2-9d1411041400 Correlation ID: 0fb2ddbd-6925-4aed-a5bc-f996481eba2b Timestamp: 2026-07-13 00:22:59Z - Correlation ID: 0fb2ddbd-6925-4aed-a5bc-f996481eba2b - Trace ID: b94518f7-5548-4901-a2e2-9d1411041400
Error getting the secret: invalid_client: 7000222 - [2026-07-13 00:22:59Z]: 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: 86f22edf-6c56-40bd-8ead-8e01a91d0e00 Correlation ID: 8624438b-e288-4501-a7dd-9db2b120e046 Timestamp: 2026-07-13 00:22:59Z - Correlation ID: 8624438b-e288-4501-a7dd-9db2b120e046 - Trace ID: 86f22edf-6c56-40bd-8ead-8e01a91d0e00
Error getting the secret: invalid_client: 7000222 - [2026-07-13 00:22:59Z]: 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: b94518f7-5548-4901-a2e2-9d1421041400 Correlation ID: 33f0450b-6709-492e-ae60-b489d39c5ccb Timestamp: 2026-07-13 00:22:59Z - Correlation ID: 33f0450b-6709-492e-ae60-b489d39c5ccb - Trace ID: b94518f7-5548-4901-a2e2-9d1421041400
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)