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 23:21:39Z]: 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: 0c0bf924-b6f7-42e4-9e0d-005bc60cc200 Correlation ID: 5e3b2fcd-66d3-4bfb-8468-aa5f946b65e9 Timestamp: 2026-10-02 23:21:39Z - Correlation ID: 5e3b2fcd-66d3-4bfb-8468-aa5f946b65e9 - Trace ID: 0c0bf924-b6f7-42e4-9e0d-005bc60cc200
(node:5736) [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 23:21:39Z]: 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: 72dc2832-c373-432c-9a79-be2113a47400 Correlation ID: 0dc3f902-ded0-4452-94e9-7222101260ea Timestamp: 2026-10-02 23:21:39Z - Correlation ID: 0dc3f902-ded0-4452-94e9-7222101260ea - Trace ID: 72dc2832-c373-432c-9a79-be2113a47400
Error getting the secret: invalid_client: 7000222 - [2026-10-02 23:21:40Z]: 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: 84c4212d-9f70-4175-ad20-deaa6f0f6400 Correlation ID: 27b39166-3598-4d5e-a375-72eaaad4caf4 Timestamp: 2026-10-02 23:21:40Z - Correlation ID: 27b39166-3598-4d5e-a375-72eaaad4caf4 - Trace ID: 84c4212d-9f70-4175-ad20-deaa6f0f6400
Error getting the secret: invalid_client: 7000222 - [2026-10-02 23:21:40Z]: 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: 202b0a37-63ba-4247-8e33-a49448056a00 Correlation ID: 6d7bf11d-ccfa-488d-88a0-63e38a34125b Timestamp: 2026-10-02 23:21:40Z - Correlation ID: 6d7bf11d-ccfa-488d-88a0-63e38a34125b - Trace ID: 202b0a37-63ba-4247-8e33-a49448056a00
Error getting the secret: invalid_client: 7000222 - [2026-10-02 23:21:40Z]: 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: f3d9c37e-f885-42fc-9c01-32e955a56c00 Correlation ID: 26baa889-93f3-4156-bc15-c3fe7ad0772b Timestamp: 2026-10-02 23:21:40Z - Correlation ID: 26baa889-93f3-4156-bc15-c3fe7ad0772b - Trace ID: f3d9c37e-f885-42fc-9c01-32e955a56c00
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)