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-03 11:33:48Z]: 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: 6869aaa6-a925-49d8-bdcf-0ee14508a800 Correlation ID: 136c9f46-5715-43ef-b483-0a4d336e7302 Timestamp: 2026-07-03 11:33:48Z - Correlation ID: 136c9f46-5715-43ef-b483-0a4d336e7302 - Trace ID: 6869aaa6-a925-49d8-bdcf-0ee14508a800
(node:796) [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-03 11:33:48Z]: 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: 8a4bd032-e0c4-47d5-ba85-6668578e1100 Correlation ID: c96d07ee-d2b4-4537-a1f4-b59e35d7b01b Timestamp: 2026-07-03 11:33:48Z - Correlation ID: c96d07ee-d2b4-4537-a1f4-b59e35d7b01b - Trace ID: 8a4bd032-e0c4-47d5-ba85-6668578e1100
Error getting the secret: invalid_client: 7000222 - [2026-07-03 11:33:48Z]: 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: 1d4f3cac-786e-4001-b9c1-2bf6c5a66800 Correlation ID: 230e8ad1-d6f7-4e3b-aa0b-018b695003e3 Timestamp: 2026-07-03 11:33:48Z - Correlation ID: 230e8ad1-d6f7-4e3b-aa0b-018b695003e3 - Trace ID: 1d4f3cac-786e-4001-b9c1-2bf6c5a66800
Error getting the secret: invalid_client: 7000222 - [2026-07-03 11:33:49Z]: 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: 6869aaa6-a925-49d8-bdcf-0ee15208a800 Correlation ID: 5e7487e1-d8a1-4eac-b658-171e1f99c49b Timestamp: 2026-07-03 11:33:49Z - Correlation ID: 5e7487e1-d8a1-4eac-b658-171e1f99c49b - Trace ID: 6869aaa6-a925-49d8-bdcf-0ee15208a800
Error getting the secret: invalid_client: 7000222 - [2026-07-03 11:33:49Z]: 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: a3e7f06a-2936-4a5c-92a2-22711031ba00 Correlation ID: 4be9f51d-1c8a-4b4b-b33e-40a426c4a56a Timestamp: 2026-07-03 11:33:49Z - Correlation ID: 4be9f51d-1c8a-4b4b-b33e-40a426c4a56a - Trace ID: a3e7f06a-2936-4a5c-92a2-22711031ba00
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)