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-12-03 14:40:05Z]: 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: 495f4677-50cc-4259-aede-56a7953f0a00 Correlation ID: e5ff3321-6593-4cef-a6b6-8331d05230bd Timestamp: 2026-12-03 14:40:05Z - Correlation ID: e5ff3321-6593-4cef-a6b6-8331d05230bd - Trace ID: 495f4677-50cc-4259-aede-56a7953f0a00
(node:6556) [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-12-03 14:40:05Z]: 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: 496478e7-58d3-4ee0-9e50-eef0d8429f00 Correlation ID: b4b4908c-63b3-4634-9c92-93f677b29328 Timestamp: 2026-12-03 14:40:05Z - Correlation ID: b4b4908c-63b3-4634-9c92-93f677b29328 - Trace ID: 496478e7-58d3-4ee0-9e50-eef0d8429f00
Error getting the secret: invalid_client: 7000222 - [2026-12-03 14:40:05Z]: 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: e26b263b-d627-412e-935c-1ba9344bb100 Correlation ID: d02e2138-363e-4204-83e3-7e6c330f7de4 Timestamp: 2026-12-03 14:40:05Z - Correlation ID: d02e2138-363e-4204-83e3-7e6c330f7de4 - Trace ID: e26b263b-d627-412e-935c-1ba9344bb100
Error getting the secret: invalid_client: 7000222 - [2026-12-03 14:40:06Z]: 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: 2b3d78cd-b2eb-4789-a519-11579f152200 Correlation ID: 9fea0c83-516b-4d43-a310-f0edae74f6cc Timestamp: 2026-12-03 14:40:06Z - Correlation ID: 9fea0c83-516b-4d43-a310-f0edae74f6cc - Trace ID: 2b3d78cd-b2eb-4789-a519-11579f152200
Application has thrown an uncaught exception and is terminated:
TypeError: Cannot read properties of undefined (reading 'username')
    at C:\vehicle_status_API\server.js:25:32
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)