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-12 14:24:54Z]: 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: 5ff30a48-6a8f-44c6-bc9f-7f3307040700 Correlation ID: e2d3f62c-0338-429d-b1b9-97bf7949fde4 Timestamp: 2026-07-12 14:24:54Z - Correlation ID: e2d3f62c-0338-429d-b1b9-97bf7949fde4 - Trace ID: 5ff30a48-6a8f-44c6-bc9f-7f3307040700
(node:168) [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-12 14:24:54Z]: 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: 62e49750-9378-410b-af96-00ef8a1d0800 Correlation ID: fef01491-8781-40df-a576-086dad14647e Timestamp: 2026-07-12 14:24:54Z - Correlation ID: fef01491-8781-40df-a576-086dad14647e - Trace ID: 62e49750-9378-410b-af96-00ef8a1d0800
Error getting the secret: invalid_client: 7000222 - [2026-07-12 14:24:54Z]: 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: 58c59e75-4f62-40ad-8bf1-6db562e10500 Correlation ID: 4b6d01fa-daac-441c-b127-d1d3249d4f9d Timestamp: 2026-07-12 14:24:54Z - Correlation ID: 4b6d01fa-daac-441c-b127-d1d3249d4f9d - Trace ID: 58c59e75-4f62-40ad-8bf1-6db562e10500
Error getting the secret: invalid_client: 7000222 - [2026-07-12 14:24:54Z]: 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: 62e49750-9378-410b-af96-00ef8c1d0800 Correlation ID: 2f1e42a7-b7cd-4147-b9fb-e10ff785aec8 Timestamp: 2026-07-12 14:24:54Z - Correlation ID: 2f1e42a7-b7cd-4147-b9fb-e10ff785aec8 - Trace ID: 62e49750-9378-410b-af96-00ef8c1d0800
Error getting the secret: invalid_client: 7000222 - [2026-07-12 14:24:55Z]: 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: 58c59e75-4f62-40ad-8bf1-6db569e10500 Correlation ID: 5176582e-4bad-40a4-aee9-14672306dc85 Timestamp: 2026-07-12 14:24:55Z - Correlation ID: 5176582e-4bad-40a4-aee9-14672306dc85 - Trace ID: 58c59e75-4f62-40ad-8bf1-6db569e10500
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)