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-25 02:40:33Z]: 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: 088c4450-02ed-49ab-bbc6-2731ba0e0300 Correlation ID: 4661dcef-a471-4c0d-a840-503d0cecf2da Timestamp: 2026-07-25 02:40:33Z - Correlation ID: 4661dcef-a471-4c0d-a840-503d0cecf2da - Trace ID: 088c4450-02ed-49ab-bbc6-2731ba0e0300
(node:4552) [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-25 02:40:33Z]: 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: c0514894-cd64-495b-bffc-b7f750bc0f00 Correlation ID: aaeca373-b815-41d3-9734-a8614fb81f0a Timestamp: 2026-07-25 02:40:33Z - Correlation ID: aaeca373-b815-41d3-9734-a8614fb81f0a - Trace ID: c0514894-cd64-495b-bffc-b7f750bc0f00
Error getting the secret: invalid_client: 7000222 - [2026-07-25 02:40:34Z]: 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: d14952aa-de9d-492b-a8b2-4ba885942300 Correlation ID: 7ea421cc-cd1c-48da-86c1-4d32262feaca Timestamp: 2026-07-25 02:40:34Z - Correlation ID: 7ea421cc-cd1c-48da-86c1-4d32262feaca - Trace ID: d14952aa-de9d-492b-a8b2-4ba885942300
Error getting the secret: invalid_client: 7000222 - [2026-07-25 02:40:34Z]: 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: 088c4450-02ed-49ab-bbc6-2731c90e0300 Correlation ID: c3c95329-5094-40fd-adb1-7ef17609caa8 Timestamp: 2026-07-25 02:40:34Z - Correlation ID: c3c95329-5094-40fd-adb1-7ef17609caa8 - Trace ID: 088c4450-02ed-49ab-bbc6-2731c90e0300
Error getting the secret: invalid_client: 7000222 - [2026-07-25 02:40:34Z]: 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: d14952aa-de9d-492b-a8b2-4ba88e942300 Correlation ID: 0b18c302-66f4-40db-9899-99f480016729 Timestamp: 2026-07-25 02:40:34Z - Correlation ID: 0b18c302-66f4-40db-9899-99f480016729 - Trace ID: d14952aa-de9d-492b-a8b2-4ba88e942300
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)