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-04-21 05:38:52Z]: 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: 7b5c708d-018e-4fa5-8d1b-94de9b562300 Correlation ID: 2a603198-e6a4-492d-9ee4-2ae7d06a2024 Timestamp: 2026-04-21 05:38:52Z - Correlation ID: 2a603198-e6a4-492d-9ee4-2ae7d06a2024 - Trace ID: 7b5c708d-018e-4fa5-8d1b-94de9b562300
(node:3972) [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-04-21 05:38:52Z]: 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: 0d8ec01b-6d8b-4acf-9751-94e9644d2400 Correlation ID: 84a7c853-f51f-4d61-8ca2-da7ca2832e9b Timestamp: 2026-04-21 05:38:52Z - Correlation ID: 84a7c853-f51f-4d61-8ca2-da7ca2832e9b - Trace ID: 0d8ec01b-6d8b-4acf-9751-94e9644d2400
Error getting the secret: invalid_client: 7000222 - [2026-04-21 05:38:52Z]: 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: 0d8ec01b-6d8b-4acf-9751-94e96b4d2400 Correlation ID: 817b964e-dde2-4911-83a8-2b1a37e24cd0 Timestamp: 2026-04-21 05:38:52Z - Correlation ID: 817b964e-dde2-4911-83a8-2b1a37e24cd0 - Trace ID: 0d8ec01b-6d8b-4acf-9751-94e96b4d2400
Error getting the secret: invalid_client: 7000222 - [2026-04-21 05:38:53Z]: 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: 48dd5922-77c2-4a73-b725-8af1f5970a00 Correlation ID: 5262bacc-059e-4683-b166-75e7e2aed5ff Timestamp: 2026-04-21 05:38:53Z - Correlation ID: 5262bacc-059e-4683-b166-75e7e2aed5ff - Trace ID: 48dd5922-77c2-4a73-b725-8af1f5970a00
Error getting the secret: invalid_client: 7000222 - [2026-04-21 05:38:53Z]: 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: 4e2ef207-b602-49be-926f-76e52e510500 Correlation ID: 3838cc07-5b37-4305-92e1-96394ab9b7b9 Timestamp: 2026-04-21 05:38:53Z - Correlation ID: 3838cc07-5b37-4305-92e1-96394ab9b7b9 - Trace ID: 4e2ef207-b602-49be-926f-76e52e510500
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)