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-02 15:20: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: 34df3583-7b12-44bd-8e1d-607b1dd9c200 Correlation ID: f2c72f89-b40a-47cf-9a4f-72e09179f3aa Timestamp: 2026-10-02 15:20:27Z - Correlation ID: f2c72f89-b40a-47cf-9a4f-72e09179f3aa - Trace ID: 34df3583-7b12-44bd-8e1d-607b1dd9c200
(node:4004) [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-02 15:20: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: 29fc34a6-2d47-4b08-a529-67080274b100 Correlation ID: 2cf872df-0155-446a-b8c4-af8b521e2018 Timestamp: 2026-10-02 15:20:27Z - Correlation ID: 2cf872df-0155-446a-b8c4-af8b521e2018 - Trace ID: 29fc34a6-2d47-4b08-a529-67080274b100
Error getting the secret: invalid_client: 7000222 - [2026-10-02 15:20: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: 55c02110-725b-4127-ab66-69b286073300 Correlation ID: 366d65b1-7646-4800-9a27-131fd03e8d7a Timestamp: 2026-10-02 15:20:28Z - Correlation ID: 366d65b1-7646-4800-9a27-131fd03e8d7a - Trace ID: 55c02110-725b-4127-ab66-69b286073300
Error getting the secret: invalid_client: 7000222 - [2026-10-02 15:20: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: 24f8a039-368e-4495-9279-09fbd2445a00 Correlation ID: 4789ad48-8e72-4076-994f-6ae6584c2724 Timestamp: 2026-10-02 15:20:28Z - Correlation ID: 4789ad48-8e72-4076-994f-6ae6584c2724 - Trace ID: 24f8a039-368e-4495-9279-09fbd2445a00
Error getting the secret: invalid_client: 7000222 - [2026-10-02 15:20: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: 1da33399-f50e-4248-8a10-dd3696515800 Correlation ID: b0f48a15-ca7f-4055-b1f1-854becea81f7 Timestamp: 2026-10-02 15:20:28Z - Correlation ID: b0f48a15-ca7f-4055-b1f1-854becea81f7 - Trace ID: 1da33399-f50e-4248-8a10-dd3696515800
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)