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-04-23 13:15:42Z]: 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: 541ee905-7433-4f7c-b77e-ee5d2e9a5b00 Correlation ID: 50c7d001-c7b3-4e1a-b17f-c7c5c606f0a6 Timestamp: 2026-04-23 13:15:42Z - Correlation ID: 50c7d001-c7b3-4e1a-b17f-c7c5c606f0a6 - Trace ID: 541ee905-7433-4f7c-b77e-ee5d2e9a5b00
(node:4628) [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-04-23 13:15:43Z]: 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: e4b6001d-fe33-45d2-ac6c-211d42036100 Correlation ID: 1ff027d7-0802-4bf3-a52c-9c8a65ded4c2 Timestamp: 2026-04-23 13:15:43Z - Correlation ID: 1ff027d7-0802-4bf3-a52c-9c8a65ded4c2 - Trace ID: e4b6001d-fe33-45d2-ac6c-211d42036100
Error getting the secret: invalid_client: 7000222 - [2026-04-23 13:15:43Z]: 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: 541ee905-7433-4f7c-b77e-ee5d559a5b00 Correlation ID: 41e693dd-4029-439e-ac33-75a8e57a41f4 Timestamp: 2026-04-23 13:15:43Z - Correlation ID: 41e693dd-4029-439e-ac33-75a8e57a41f4 - Trace ID: 541ee905-7433-4f7c-b77e-ee5d559a5b00
Error getting the secret: invalid_client: 7000222 - [2026-04-23 13:15:43Z]: 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: 90bb0367-a561-47e6-9fb9-4268a4494900 Correlation ID: 0677fa95-a9e9-4167-890a-282d128ae4f2 Timestamp: 2026-04-23 13:15:43Z - Correlation ID: 0677fa95-a9e9-4167-890a-282d128ae4f2 - Trace ID: 90bb0367-a561-47e6-9fb9-4268a4494900
Application has thrown an uncaught exception and is terminated:
TypeError: Cannot read properties of undefined (reading 'username')
    at C:\vehicle_status_API\server.js:25:32
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)