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-06 14:17:58Z]: 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: 3c2428e4-f402-4ef5-9e97-cef1f182d700 Correlation ID: ec5a09fa-4c36-467b-84ff-4387702cc873 Timestamp: 2026-10-06 14:17:58Z - Correlation ID: ec5a09fa-4c36-467b-84ff-4387702cc873 - Trace ID: 3c2428e4-f402-4ef5-9e97-cef1f182d700
(node:1860) [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-06 14:17:58Z]: 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: cf0d9a63-94de-4a47-9e5c-5158aeabe200 Correlation ID: c7740245-0bae-477a-b0f7-e967e49a3617 Timestamp: 2026-10-06 14:17:58Z - Correlation ID: c7740245-0bae-477a-b0f7-e967e49a3617 - Trace ID: cf0d9a63-94de-4a47-9e5c-5158aeabe200
Error getting the secret: invalid_client: 7000222 - [2026-10-06 14:17:58Z]: 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: 698cdee4-e75e-4850-aaef-5872bf182700 Correlation ID: eeccace5-b71b-4932-bd9c-2543cf5676b0 Timestamp: 2026-10-06 14:17:58Z - Correlation ID: eeccace5-b71b-4932-bd9c-2543cf5676b0 - Trace ID: 698cdee4-e75e-4850-aaef-5872bf182700
Error getting the secret: invalid_client: 7000222 - [2026-10-06 14:17:58Z]: 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: 698cdee4-e75e-4850-aaef-5872cf182700 Correlation ID: 805a361e-4218-440f-bd59-a96e5d0b9b22 Timestamp: 2026-10-06 14:17:58Z - Correlation ID: 805a361e-4218-440f-bd59-a96e5d0b9b22 - Trace ID: 698cdee4-e75e-4850-aaef-5872cf182700
Error getting the secret: invalid_client: 7000222 - [2026-10-06 14:17:59Z]: 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: c7306013-3ecc-4ed9-9a3d-0b37a82bf300 Correlation ID: fb174454-2275-4070-8b1c-4d27013224ce Timestamp: 2026-10-06 14:17:59Z - Correlation ID: fb174454-2275-4070-8b1c-4d27013224ce - Trace ID: c7306013-3ecc-4ed9-9a3d-0b37a82bf300
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)