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-20 17:29: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: abc95d59-ca1f-497b-9bdd-7e35d8a82f00 Correlation ID: c1e31f27-3062-4fc9-9c4d-c11f95726589 Timestamp: 2026-07-20 17:29:29Z - Correlation ID: c1e31f27-3062-4fc9-9c4d-c11f95726589 - Trace ID: abc95d59-ca1f-497b-9bdd-7e35d8a82f00
(node:5140) [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-20 17:29: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: 945f565f-43af-47f0-aea4-f63e779d3800 Correlation ID: 695a85bf-8912-4564-b1b4-2739da27ecc2 Timestamp: 2026-07-20 17:29:29Z - Correlation ID: 695a85bf-8912-4564-b1b4-2739da27ecc2 - Trace ID: 945f565f-43af-47f0-aea4-f63e779d3800
Error getting the secret: invalid_client: 7000222 - [2026-07-20 17:29:30Z]: 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: 02c4de41-b5c9-4ca5-baac-8d6a9b8b0a00 Correlation ID: 71b92155-f125-47b5-814b-bdb42db77d5e Timestamp: 2026-07-20 17:29:30Z - Correlation ID: 71b92155-f125-47b5-814b-bdb42db77d5e - Trace ID: 02c4de41-b5c9-4ca5-baac-8d6a9b8b0a00
Error getting the secret: invalid_client: 7000222 - [2026-07-20 17:29:30Z]: 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: 49608646-1241-4af9-a980-d303b5d80b00 Correlation ID: 6b812bd4-edc1-4fa1-843d-a1d3b6c5b9fd Timestamp: 2026-07-20 17:29:30Z - Correlation ID: 6b812bd4-edc1-4fa1-843d-a1d3b6c5b9fd - Trace ID: 49608646-1241-4af9-a980-d303b5d80b00
Error getting the secret: invalid_client: 7000222 - [2026-07-20 17:29:30Z]: 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: 8829db27-91e4-458d-8ad0-7a6aa3820d00 Correlation ID: a36b1544-27c0-4c40-9858-2d06ff146fc6 Timestamp: 2026-07-20 17:29:30Z - Correlation ID: a36b1544-27c0-4c40-9858-2d06ff146fc6 - Trace ID: 8829db27-91e4-458d-8ad0-7a6aa3820d00
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)