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-10-06 20:26:27Z]: 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: 33a10954-c42c-4520-96b6-1f4a807cfa00 Correlation ID: 741ada1d-80a8-40e7-97f1-3245967e39a9 Timestamp: 2026-10-06 20:26:27Z - Correlation ID: 741ada1d-80a8-40e7-97f1-3245967e39a9 - Trace ID: 33a10954-c42c-4520-96b6-1f4a807cfa00
(node:4348) [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-10-06 20:26:28Z]: 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: 63400f3f-1747-4ef7-8433-6bc4bc040200 Correlation ID: 16f48d2c-ec51-4685-9d61-0b4fd4e78492 Timestamp: 2026-10-06 20:26:28Z - Correlation ID: 16f48d2c-ec51-4685-9d61-0b4fd4e78492 - Trace ID: 63400f3f-1747-4ef7-8433-6bc4bc040200
Error getting the secret: invalid_client: 7000222 - [2026-10-06 20:26:28Z]: 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: d9f69c2b-1fd7-4a36-8574-891b56f53201 Correlation ID: 03a4c028-4396-48a6-91a4-327d9f6ebe70 Timestamp: 2026-10-06 20:26:28Z - Correlation ID: 03a4c028-4396-48a6-91a4-327d9f6ebe70 - Trace ID: d9f69c2b-1fd7-4a36-8574-891b56f53201
Error getting the secret: invalid_client: 7000222 - [2026-10-06 20:26:28Z]: 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: 208ef04f-c3f2-45c9-96e8-dff516a63d00 Correlation ID: 8fd05322-6c19-4389-923f-cf69a173f5bc Timestamp: 2026-10-06 20:26:28Z - Correlation ID: 8fd05322-6c19-4389-923f-cf69a173f5bc - Trace ID: 208ef04f-c3f2-45c9-96e8-dff516a63d00
Error getting the secret: invalid_client: 7000222 - [2026-10-06 20:26:29Z]: 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: c4f98b29-85d1-4fcf-8cb0-cedbde500500 Correlation ID: ad5a8801-f6c1-48ad-8279-4938bafa18f1 Timestamp: 2026-10-06 20:26:29Z - Correlation ID: ad5a8801-f6c1-48ad-8279-4938bafa18f1 - Trace ID: c4f98b29-85d1-4fcf-8cb0-cedbde500500
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)