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-05 07:39:43Z]: 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: 8758feb9-5767-4a56-bc9e-2f4d316e1a00 Correlation ID: e7f6691b-f32a-44f0-9de5-83bb28877ec3 Timestamp: 2026-07-05 07:39:43Z - Correlation ID: e7f6691b-f32a-44f0-9de5-83bb28877ec3 - Trace ID: 8758feb9-5767-4a56-bc9e-2f4d316e1a00
(node:3940) [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-05 07:39:43Z]: 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: ca2b98fe-6cc6-4af8-a126-5cdc984a1900 Correlation ID: 1aeaee69-0ba4-4dc3-b0cd-b89a88b18c4a Timestamp: 2026-07-05 07:39:43Z - Correlation ID: 1aeaee69-0ba4-4dc3-b0cd-b89a88b18c4a - Trace ID: ca2b98fe-6cc6-4af8-a126-5cdc984a1900
Error getting the secret: invalid_client: 7000222 - [2026-07-05 07:39: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: 54e99a22-e524-4510-863d-9728ca731500 Correlation ID: 01acc179-ae87-48f3-8ed5-3663d2549fa8 Timestamp: 2026-07-05 07:39:44Z - Correlation ID: 01acc179-ae87-48f3-8ed5-3663d2549fa8 - Trace ID: 54e99a22-e524-4510-863d-9728ca731500
Error getting the secret: invalid_client: 7000222 - [2026-07-05 07:39: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: d87ab077-0a89-40d7-a94a-734aff1e1500 Correlation ID: dd7140f4-4278-4fff-b538-9d76ba38823f Timestamp: 2026-07-05 07:39:44Z - Correlation ID: dd7140f4-4278-4fff-b538-9d76ba38823f - Trace ID: d87ab077-0a89-40d7-a94a-734aff1e1500
Error getting the secret: invalid_client: 7000222 - [2026-07-05 07:39: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: 78d07df1-69e0-4788-a513-ad41a35c1500 Correlation ID: 44f1cbbe-d475-442e-b9a5-5adae25cdc7c Timestamp: 2026-07-05 07:39:44Z - Correlation ID: 44f1cbbe-d475-442e-b9a5-5adae25cdc7c - Trace ID: 78d07df1-69e0-4788-a513-ad41a35c1500
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)