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-17 11:44:13Z]: 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: 644f6a28-6c67-4fb7-b264-eea8b9204700 Correlation ID: c582672e-611e-4df7-8cba-916b4bd51656 Timestamp: 2026-07-17 11:44:13Z - Correlation ID: c582672e-611e-4df7-8cba-916b4bd51656 - Trace ID: 644f6a28-6c67-4fb7-b264-eea8b9204700
(node:4448) [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-17 11:44:14Z]: 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: 656d8c69-3886-44b0-b4b5-a51970304600 Correlation ID: 24673741-97c3-4603-a0fe-466f0e8155c6 Timestamp: 2026-07-17 11:44:14Z - Correlation ID: 24673741-97c3-4603-a0fe-466f0e8155c6 - Trace ID: 656d8c69-3886-44b0-b4b5-a51970304600
Error getting the secret: invalid_client: 7000222 - [2026-07-17 11:44:14Z]: 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: 9175bb5b-957b-4c39-828d-fbe87d5b2700 Correlation ID: 5ec73acd-22fb-430d-bb44-04b7d3c8f91f Timestamp: 2026-07-17 11:44:14Z - Correlation ID: 5ec73acd-22fb-430d-bb44-04b7d3c8f91f - Trace ID: 9175bb5b-957b-4c39-828d-fbe87d5b2700
Error getting the secret: invalid_client: 7000222 - [2026-07-17 11:44:14Z]: 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: 76b96a9a-3d1c-443a-8398-c4d914462700 Correlation ID: d558cfb7-b9f3-41fc-ba6e-3a7d089b20c8 Timestamp: 2026-07-17 11:44:14Z - Correlation ID: d558cfb7-b9f3-41fc-ba6e-3a7d089b20c8 - Trace ID: 76b96a9a-3d1c-443a-8398-c4d914462700
Error getting the secret: invalid_client: 7000222 - [2026-07-17 11:44:15Z]: 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: d801fc4e-b178-4e3d-825e-9f2786613500 Correlation ID: 8a9799ac-62ff-46c7-8c43-75b6c1739de3 Timestamp: 2026-07-17 11:44:15Z - Correlation ID: 8a9799ac-62ff-46c7-8c43-75b6c1739de3 - Trace ID: d801fc4e-b178-4e3d-825e-9f2786613500
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)