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 13:30:42Z]: 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: 5cd44dfd-7bb2-4da0-b6a5-179427172b00 Correlation ID: ec3790e8-62de-4a5d-b688-b102ed6e06c2 Timestamp: 2026-07-09 13:30:42Z - Correlation ID: ec3790e8-62de-4a5d-b688-b102ed6e06c2 - Trace ID: 5cd44dfd-7bb2-4da0-b6a5-179427172b00
(node:4832) [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 13:30: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: 0e54eebc-d811-45e9-9775-55ad6c188000 Correlation ID: f0de3f6c-2f12-4e0d-9fc6-33459410957e Timestamp: 2026-07-09 13:30:43Z - Correlation ID: f0de3f6c-2f12-4e0d-9fc6-33459410957e - Trace ID: 0e54eebc-d811-45e9-9775-55ad6c188000
Error getting the secret: invalid_client: 7000222 - [2026-07-09 13:30: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: d29d4fa2-d29e-4530-a300-6d7d36e8a000 Correlation ID: 4d4e94bf-1810-48fa-a34e-df7bb748795b Timestamp: 2026-07-09 13:30:43Z - Correlation ID: 4d4e94bf-1810-48fa-a34e-df7bb748795b - Trace ID: d29d4fa2-d29e-4530-a300-6d7d36e8a000
Error getting the secret: invalid_client: 7000222 - [2026-07-09 13:30: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: c2604cb4-873c-4db0-8439-bef98e739100 Correlation ID: de8f878a-9ca0-48aa-a239-0d038ad008a6 Timestamp: 2026-07-09 13:30:43Z - Correlation ID: de8f878a-9ca0-48aa-a239-0d038ad008a6 - Trace ID: c2604cb4-873c-4db0-8439-bef98e739100
Error getting the secret: invalid_client: 7000222 - [2026-07-09 13:30: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: 008cfb33-29f0-408c-8748-19d74ebf0500 Correlation ID: 692feb65-40eb-4df4-a123-2270e3326d46 Timestamp: 2026-07-09 13:30:44Z - Correlation ID: 692feb65-40eb-4df4-a123-2270e3326d46 - Trace ID: 008cfb33-29f0-408c-8748-19d74ebf0500
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)