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-16 11:29:26Z]: 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: e3d85e0d-f8fb-42a3-99d2-df3ae6ab2d00 Correlation ID: d75a7ebd-b15a-41bc-8d10-98f05cc1365f Timestamp: 2026-07-16 11:29:26Z - Correlation ID: d75a7ebd-b15a-41bc-8d10-98f05cc1365f - Trace ID: e3d85e0d-f8fb-42a3-99d2-df3ae6ab2d00
(node:1032) [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-16 11:29:26Z]: 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: 6727b56d-5a50-46d2-a083-9dfd46332d00 Correlation ID: 39114ea9-e0c6-4124-bb16-612993c3e97d Timestamp: 2026-07-16 11:29:26Z - Correlation ID: 39114ea9-e0c6-4124-bb16-612993c3e97d - Trace ID: 6727b56d-5a50-46d2-a083-9dfd46332d00
Error getting the secret: invalid_client: 7000222 - [2026-07-16 11:29:26Z]: 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: c96de64b-6bf0-4be3-b88b-ac5afc3f3000 Correlation ID: 3ee5c4ef-b027-414f-a1bb-5bafb779f651 Timestamp: 2026-07-16 11:29:26Z - Correlation ID: 3ee5c4ef-b027-414f-a1bb-5bafb779f651 - Trace ID: c96de64b-6bf0-4be3-b88b-ac5afc3f3000
Error getting the secret: invalid_client: 7000222 - [2026-07-16 11:29:27Z]: 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: b4ee9f95-11e1-445a-8930-452f88912d00 Correlation ID: 9820b7d9-5978-4767-84b7-ff47f7e22084 Timestamp: 2026-07-16 11:29:27Z - Correlation ID: 9820b7d9-5978-4767-84b7-ff47f7e22084 - Trace ID: b4ee9f95-11e1-445a-8930-452f88912d00
Error getting the secret: invalid_client: 7000222 - [2026-07-16 11:29:27Z]: 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: 6727b56d-5a50-46d2-a083-9dfd56332d00 Correlation ID: a7c76cd1-875c-413d-a17f-a07a547e286f Timestamp: 2026-07-16 11:29:27Z - Correlation ID: a7c76cd1-875c-413d-a17f-a07a547e286f - Trace ID: 6727b56d-5a50-46d2-a083-9dfd56332d00
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)