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-07 19:32:29Z]: 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: 5cac5c13-409f-4ecf-9575-672296c45f00 Correlation ID: 5ead7732-6e47-4d60-be1d-43cc54ac4cd2 Timestamp: 2026-07-07 19:32:29Z - Correlation ID: 5ead7732-6e47-4d60-be1d-43cc54ac4cd2 - Trace ID: 5cac5c13-409f-4ecf-9575-672296c45f00
(node:5224) [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-07 19:32:29Z]: 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: a3d6d2d2-8686-426b-8e4a-b6a875f26100 Correlation ID: 9a60c3e0-57e0-4a28-baf5-17e77bf83415 Timestamp: 2026-07-07 19:32:29Z - Correlation ID: 9a60c3e0-57e0-4a28-baf5-17e77bf83415 - Trace ID: a3d6d2d2-8686-426b-8e4a-b6a875f26100
Error getting the secret: invalid_client: 7000222 - [2026-07-07 19:32:29Z]: 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: 6afc1fe4-1f1f-4c6f-b37b-3f31272f2100 Correlation ID: bc0cc79b-2575-4d0e-8d99-dc788eec0ebd Timestamp: 2026-07-07 19:32:29Z - Correlation ID: bc0cc79b-2575-4d0e-8d99-dc788eec0ebd - Trace ID: 6afc1fe4-1f1f-4c6f-b37b-3f31272f2100
Error getting the secret: invalid_client: 7000222 - [2026-07-07 19:32:30Z]: 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: ff3f2fdb-4fea-4b4a-b1d0-6271462f1200 Correlation ID: efecc611-e7c6-412c-8075-99dbf549695a Timestamp: 2026-07-07 19:32:30Z - Correlation ID: efecc611-e7c6-412c-8075-99dbf549695a - Trace ID: ff3f2fdb-4fea-4b4a-b1d0-6271462f1200
Error getting the secret: invalid_client: 7000222 - [2026-07-07 19:32:30Z]: 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: 12e5a2c5-b20e-4379-947a-295c91e65400 Correlation ID: 239c544a-cfc3-40d2-8f86-195c960366d0 Timestamp: 2026-07-07 19:32:30Z - Correlation ID: 239c544a-cfc3-40d2-8f86-195c960366d0 - Trace ID: 12e5a2c5-b20e-4379-947a-295c91e65400
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)