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-24 10:43:44Z]: 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: e2c86aa2-61e1-4bca-bf00-d318326b5900 Correlation ID: 36a740c2-94fd-45dc-833f-371ef7fbb831 Timestamp: 2026-07-24 10:43:44Z - Correlation ID: 36a740c2-94fd-45dc-833f-371ef7fbb831 - Trace ID: e2c86aa2-61e1-4bca-bf00-d318326b5900
(node:888) [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-24 10:43:45Z]: 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: 408def65-2dfc-4d03-b906-e0938a3e5800 Correlation ID: 16d514cc-8365-4db7-8bba-1ed5d7a267e8 Timestamp: 2026-07-24 10:43:45Z - Correlation ID: 16d514cc-8365-4db7-8bba-1ed5d7a267e8 - Trace ID: 408def65-2dfc-4d03-b906-e0938a3e5800
Error getting the secret: invalid_client: 7000222 - [2026-07-24 10:43:45Z]: 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: e2c86aa2-61e1-4bca-bf00-d318366b5900 Correlation ID: 470d42c7-32fa-4fe4-8ff1-100b4149599f Timestamp: 2026-07-24 10:43:45Z - Correlation ID: 470d42c7-32fa-4fe4-8ff1-100b4149599f - Trace ID: e2c86aa2-61e1-4bca-bf00-d318366b5900
Error getting the secret: invalid_client: 7000222 - [2026-07-24 10:43:45Z]: 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: ba0b4dd2-037d-4986-9a6c-62e5130f0400 Correlation ID: 52603cb6-d073-4a7e-a75d-5b5227f08c40 Timestamp: 2026-07-24 10:43:45Z - Correlation ID: 52603cb6-d073-4a7e-a75d-5b5227f08c40 - Trace ID: ba0b4dd2-037d-4986-9a6c-62e5130f0400
Error getting the secret: invalid_client: 7000222 - [2026-07-24 10:43:45Z]: 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: 408def65-2dfc-4d03-b906-e0938f3e5800 Correlation ID: 24f350de-9624-4afd-8216-ec6c9a6f0938 Timestamp: 2026-07-24 10:43:45Z - Correlation ID: 24f350de-9624-4afd-8216-ec6c9a6f0938 - Trace ID: 408def65-2dfc-4d03-b906-e0938f3e5800
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)