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-09 17:21:20Z]: 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: f1b094a3-1e66-4ef9-9005-59f1bdf59500 Correlation ID: fdd9fd7b-e7ac-438c-92f3-c1df9b23db7f Timestamp: 2026-07-09 17:21:20Z - Correlation ID: fdd9fd7b-e7ac-438c-92f3-c1df9b23db7f - Trace ID: f1b094a3-1e66-4ef9-9005-59f1bdf59500
(node:376) [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-09 17:21:21Z]: 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: 7ca69938-07a3-4658-a061-baebd1063500 Correlation ID: 938c11b0-5d0c-4957-a9ea-78a8f6332bf1 Timestamp: 2026-07-09 17:21:21Z - Correlation ID: 938c11b0-5d0c-4957-a9ea-78a8f6332bf1 - Trace ID: 7ca69938-07a3-4658-a061-baebd1063500
Error getting the secret: invalid_client: 7000222 - [2026-07-09 17:21:21Z]: 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: 721327e3-5393-4422-bae0-bf66e1800000 Correlation ID: 1b5e277d-4003-4a58-87fb-88d997efbe86 Timestamp: 2026-07-09 17:21:21Z - Correlation ID: 1b5e277d-4003-4a58-87fb-88d997efbe86 - Trace ID: 721327e3-5393-4422-bae0-bf66e1800000
Error getting the secret: invalid_client: 7000222 - [2026-07-09 17:21:21Z]: 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: 019fd07b-4d51-4bb3-a254-6450e8d59100 Correlation ID: 7d9a7e43-5bed-4db8-ad87-246dc306c032 Timestamp: 2026-07-09 17:21:21Z - Correlation ID: 7d9a7e43-5bed-4db8-ad87-246dc306c032 - Trace ID: 019fd07b-4d51-4bb3-a254-6450e8d59100
Error getting the secret: invalid_client: 7000222 - [2026-07-09 17:21:22Z]: 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: 565ad145-5c86-49c7-9fd0-6286c4ac9600 Correlation ID: 274fa714-f324-4aba-a9c9-2ce5ceb2885d Timestamp: 2026-07-09 17:21:22Z - Correlation ID: 274fa714-f324-4aba-a9c9-2ce5ceb2885d - Trace ID: 565ad145-5c86-49c7-9fd0-6286c4ac9600
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)