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-19 15:37: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: 5eb74564-bf13-4a06-8471-e5a68dc41700 Correlation ID: 043912a9-3db6-4f9c-a06e-af0bb41b7206 Timestamp: 2026-07-19 15:37:43Z - Correlation ID: 043912a9-3db6-4f9c-a06e-af0bb41b7206 - Trace ID: 5eb74564-bf13-4a06-8471-e5a68dc41700
(node:2360) [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-19 15:37: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: 14244086-0275-4642-aeaf-ab036ee91800 Correlation ID: f8e83000-2807-4ff3-a72a-36c59a1d6240 Timestamp: 2026-07-19 15:37:43Z - Correlation ID: f8e83000-2807-4ff3-a72a-36c59a1d6240 - Trace ID: 14244086-0275-4642-aeaf-ab036ee91800
Error getting the secret: invalid_client: 7000222 - [2026-07-19 15:37: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: 6eeab6cf-0bd5-4a8c-b86b-4c78a8eb1900 Correlation ID: 269c9d6f-6e44-4c93-aabc-719a0afe2f1b Timestamp: 2026-07-19 15:37:43Z - Correlation ID: 269c9d6f-6e44-4c93-aabc-719a0afe2f1b - Trace ID: 6eeab6cf-0bd5-4a8c-b86b-4c78a8eb1900
Error getting the secret: invalid_client: 7000222 - [2026-07-19 15:37: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: 5c8fc578-3704-4162-bd91-9c0a17281b00 Correlation ID: e27fae53-8fe4-4b56-990d-64228c14b166 Timestamp: 2026-07-19 15:37:43Z - Correlation ID: e27fae53-8fe4-4b56-990d-64228c14b166 - Trace ID: 5c8fc578-3704-4162-bd91-9c0a17281b00
Error getting the secret: invalid_client: 7000222 - [2026-07-19 15:37: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: a9d1681f-8f8a-4f07-ac4a-b20ccbd21700 Correlation ID: a50ba6b9-bf23-432c-9b82-46bd70fd4f94 Timestamp: 2026-07-19 15:37:43Z - Correlation ID: a50ba6b9-bf23-432c-9b82-46bd70fd4f94 - Trace ID: a9d1681f-8f8a-4f07-ac4a-b20ccbd21700
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)