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-02 11:35:06Z]: 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: bbef271a-ddac-4ca5-bac1-9f2c90621300 Correlation ID: e6c4354e-51fd-4bb9-911f-9645099b8af0 Timestamp: 2026-07-02 11:35:06Z - Correlation ID: e6c4354e-51fd-4bb9-911f-9645099b8af0 - Trace ID: bbef271a-ddac-4ca5-bac1-9f2c90621300
(node:5952) [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-02 11:35:06Z]: 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: 1dec2447-c1d6-40bb-8ad1-8d6ee2290300 Correlation ID: 6a8b1366-bd46-422d-967d-d0e4495f8b56 Timestamp: 2026-07-02 11:35:06Z - Correlation ID: 6a8b1366-bd46-422d-967d-d0e4495f8b56 - Trace ID: 1dec2447-c1d6-40bb-8ad1-8d6ee2290300
Error getting the secret: invalid_client: 7000222 - [2026-07-02 11:35:07Z]: 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: 9e2eb889-91e7-42eb-9630-688b52c90300 Correlation ID: d2d12974-5868-4042-8281-ab03bb2a3cd3 Timestamp: 2026-07-02 11:35:07Z - Correlation ID: d2d12974-5868-4042-8281-ab03bb2a3cd3 - Trace ID: 9e2eb889-91e7-42eb-9630-688b52c90300
Error getting the secret: invalid_client: 7000222 - [2026-07-02 11:35:07Z]: 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: 0d9dfe4b-e2bb-4012-afce-289c9ec21100 Correlation ID: 5198bcf0-882c-4def-ad18-1c2a4edcfe40 Timestamp: 2026-07-02 11:35:07Z - Correlation ID: 5198bcf0-882c-4def-ad18-1c2a4edcfe40 - Trace ID: 0d9dfe4b-e2bb-4012-afce-289c9ec21100
Error getting the secret: invalid_client: 7000222 - [2026-07-02 11:35:07Z]: 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: 30821b0b-0aa4-4a66-a136-96a28d1c1000 Correlation ID: 15c8d9d8-2b5e-4b92-90a4-1f8cb6967618 Timestamp: 2026-07-02 11:35:07Z - Correlation ID: 15c8d9d8-2b5e-4b92-90a4-1f8cb6967618 - Trace ID: 30821b0b-0aa4-4a66-a136-96a28d1c1000
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)