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-02 21:36:06Z]: 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: 12be9c11-a80a-43f9-a0d3-eb4add4c1200 Correlation ID: 9424837b-c2e8-438e-90e1-b4a913bf408d Timestamp: 2026-07-02 21:36:06Z - Correlation ID: 9424837b-c2e8-438e-90e1-b4a913bf408d - Trace ID: 12be9c11-a80a-43f9-a0d3-eb4add4c1200
(node:2548) [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-02 21:36:06Z]: 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: 01185403-0a32-48d7-a3ec-03c12f742b00 Correlation ID: f6da4b32-4555-4c28-b643-17810c5c9b61 Timestamp: 2026-07-02 21:36:06Z - Correlation ID: f6da4b32-4555-4c28-b643-17810c5c9b61 - Trace ID: 01185403-0a32-48d7-a3ec-03c12f742b00
Error getting the secret: invalid_client: 7000222 - [2026-07-02 21:36:07Z]: 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: fc3eeaec-8f7b-44b0-97ed-a016f8354800 Correlation ID: 94aeafd1-4a9d-42db-8639-bf5819c9b978 Timestamp: 2026-07-02 21:36:07Z - Correlation ID: 94aeafd1-4a9d-42db-8639-bf5819c9b978 - Trace ID: fc3eeaec-8f7b-44b0-97ed-a016f8354800
Error getting the secret: invalid_client: 7000222 - [2026-07-02 21:36:07Z]: 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: f43a78e7-f412-445a-9c6c-594aec711a00 Correlation ID: f78f45d0-b91e-43e2-a366-a754b7f0dd01 Timestamp: 2026-07-02 21:36:07Z - Correlation ID: f78f45d0-b91e-43e2-a366-a754b7f0dd01 - Trace ID: f43a78e7-f412-445a-9c6c-594aec711a00
Error getting the secret: invalid_client: 7000222 - [2026-07-02 21:36:07Z]: 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: c16a57ed-bcd7-489d-b47d-32d7d7ad1a00 Correlation ID: cae94490-1803-49b1-bd50-92648df86d66 Timestamp: 2026-07-02 21:36:07Z - Correlation ID: cae94490-1803-49b1-bd50-92648df86d66 - Trace ID: c16a57ed-bcd7-489d-b47d-32d7d7ad1a00
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)