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-23 22:35:15Z]: 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: 979b80bb-e690-4055-9e4b-3b33cbc81300 Correlation ID: f179bbb2-7e20-431c-8a66-fda2d2cc8083 Timestamp: 2026-07-23 22:35:15Z - Correlation ID: f179bbb2-7e20-431c-8a66-fda2d2cc8083 - Trace ID: 979b80bb-e690-4055-9e4b-3b33cbc81300
(node:4252) [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-23 22:35:15Z]: 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: 9f9c01cc-be92-4b23-be52-8c8187735f00 Correlation ID: 98a6aeba-613d-47b0-8a9d-7badabb64328 Timestamp: 2026-07-23 22:35:15Z - Correlation ID: 98a6aeba-613d-47b0-8a9d-7badabb64328 - Trace ID: 9f9c01cc-be92-4b23-be52-8c8187735f00
Error getting the secret: invalid_client: 7000222 - [2026-07-23 22:35:15Z]: 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: d093c39b-c281-418d-a4ec-d4dcc6d26700 Correlation ID: d91f08e2-adeb-4a36-8661-e6a9e4941b32 Timestamp: 2026-07-23 22:35:15Z - Correlation ID: d91f08e2-adeb-4a36-8661-e6a9e4941b32 - Trace ID: d093c39b-c281-418d-a4ec-d4dcc6d26700
Error getting the secret: invalid_client: 7000222 - [2026-07-23 22:35:15Z]: 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: 9622f2ce-57ea-40c0-aa65-e9660f114f00 Correlation ID: 354747a0-53ec-4f61-a1bd-ded1e5c52bbd Timestamp: 2026-07-23 22:35:15Z - Correlation ID: 354747a0-53ec-4f61-a1bd-ded1e5c52bbd - Trace ID: 9622f2ce-57ea-40c0-aa65-e9660f114f00
Error getting the secret: invalid_client: 7000222 - [2026-07-23 22:35:15Z]: 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: 82f5e1be-c375-4291-80a1-5d10d02c5a00 Correlation ID: db4d581c-8d9a-4de5-8f4c-e1e2c1602571 Timestamp: 2026-07-23 22:35:15Z - Correlation ID: db4d581c-8d9a-4de5-8f4c-e1e2c1602571 - Trace ID: 82f5e1be-c375-4291-80a1-5d10d02c5a00
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)