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 12:42:23Z]: 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: b82c3781-d30d-4846-bd24-3dc391b70700 Correlation ID: 2251efcd-dfbc-4946-bb2a-49e2da440b86 Timestamp: 2026-07-25 12:42:23Z - Correlation ID: 2251efcd-dfbc-4946-bb2a-49e2da440b86 - Trace ID: b82c3781-d30d-4846-bd24-3dc391b70700
(node:2144) [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 12:42:23Z]: 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: c3cb2117-4674-4b1f-b612-940835490a00 Correlation ID: dc409bee-5d6c-4211-b4fd-6ae39863d981 Timestamp: 2026-07-25 12:42:23Z - Correlation ID: dc409bee-5d6c-4211-b4fd-6ae39863d981 - Trace ID: c3cb2117-4674-4b1f-b612-940835490a00
Error getting the secret: invalid_client: 7000222 - [2026-07-25 12:42:23Z]: 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: e505eacd-6906-41be-bceb-64cf82e40900 Correlation ID: a2443f9f-8bab-4b54-a139-ed00d5241316 Timestamp: 2026-07-25 12:42:23Z - Correlation ID: a2443f9f-8bab-4b54-a139-ed00d5241316 - Trace ID: e505eacd-6906-41be-bceb-64cf82e40900
Error getting the secret: invalid_client: 7000222 - [2026-07-25 12:42:23Z]: 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: 2dba798c-dc48-44ff-af91-6c853d294600 Correlation ID: 4dac4b40-296f-4d44-b87e-fd2d43809c37 Timestamp: 2026-07-25 12:42:23Z - Correlation ID: 4dac4b40-296f-4d44-b87e-fd2d43809c37 - Trace ID: 2dba798c-dc48-44ff-af91-6c853d294600
Error getting the secret: invalid_client: 7000222 - [2026-07-25 12:42:23Z]: 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: 5f4f0503-ca27-4b4a-adfe-cba040f20700 Correlation ID: fe06b465-4a3a-43d4-9329-d6f3de594d3f Timestamp: 2026-07-25 12:42:23Z - Correlation ID: fe06b465-4a3a-43d4-9329-d6f3de594d3f - Trace ID: 5f4f0503-ca27-4b4a-adfe-cba040f20700
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)