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-10-05 20:21:32Z]: 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: 778d078d-4cb5-4b38-bf89-3ffe75c16101 Correlation ID: b6b75340-d885-4e1e-9efc-3b61fad030e1 Timestamp: 2026-10-05 20:21:32Z - Correlation ID: b6b75340-d885-4e1e-9efc-3b61fad030e1 - Trace ID: 778d078d-4cb5-4b38-bf89-3ffe75c16101
(node:4856) [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-10-05 20:21:32Z]: 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: 505e9ae6-3697-45ed-890f-b094f8221001 Correlation ID: 12da0969-1fea-4d0b-b781-76586a15c825 Timestamp: 2026-10-05 20:21:32Z - Correlation ID: 12da0969-1fea-4d0b-b781-76586a15c825 - Trace ID: 505e9ae6-3697-45ed-890f-b094f8221001
Error getting the secret: invalid_client: 7000222 - [2026-10-05 20:21:32Z]: 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: 3c05790e-a17c-432a-b66e-2ca4b2267a00 Correlation ID: 758bbe45-d98f-412e-a9f7-ace014ba48db Timestamp: 2026-10-05 20:21:32Z - Correlation ID: 758bbe45-d98f-412e-a9f7-ace014ba48db - Trace ID: 3c05790e-a17c-432a-b66e-2ca4b2267a00
Error getting the secret: invalid_client: 7000222 - [2026-10-05 20:21:32Z]: 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: f17740cc-1321-4bca-b290-c467f4185501 Correlation ID: 88ac8c0c-b845-4a43-b50b-3eb3930e5723 Timestamp: 2026-10-05 20:21:32Z - Correlation ID: 88ac8c0c-b845-4a43-b50b-3eb3930e5723 - Trace ID: f17740cc-1321-4bca-b290-c467f4185501
Error getting the secret: invalid_client: 7000222 - [2026-10-05 20:21:33Z]: 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: 2fd35ac9-2b51-4d36-87c0-3de0942be100 Correlation ID: 9ad16393-405f-41d8-b1e3-d3be61dac67f Timestamp: 2026-10-05 20:21:33Z - Correlation ID: 9ad16393-405f-41d8-b1e3-d3be61dac67f - Trace ID: 2fd35ac9-2b51-4d36-87c0-3de0942be100
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)