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 10:22:08Z]: 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: c91774a1-c5ee-47e6-82a7-e9e7b8070400 Correlation ID: 21c3dba4-9e58-4fef-82d8-12fc31ad7fb7 Timestamp: 2026-07-12 10:22:08Z - Correlation ID: 21c3dba4-9e58-4fef-82d8-12fc31ad7fb7 - Trace ID: c91774a1-c5ee-47e6-82a7-e9e7b8070400
(node:3288) [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 10:22:09Z]: 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: c91774a1-c5ee-47e6-82a7-e9e7bf070400 Correlation ID: 5e5b2556-e73d-408f-b6eb-a3d283a066b0 Timestamp: 2026-07-12 10:22:09Z - Correlation ID: 5e5b2556-e73d-408f-b6eb-a3d283a066b0 - Trace ID: c91774a1-c5ee-47e6-82a7-e9e7bf070400
Error getting the secret: invalid_client: 7000222 - [2026-07-12 10:22:09Z]: 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: 740c10a6-c10d-4d3c-b9fa-189cd5ea0b00 Correlation ID: 96df2c0e-04b1-4550-9ac9-8e09c50ad707 Timestamp: 2026-07-12 10:22:09Z - Correlation ID: 96df2c0e-04b1-4550-9ac9-8e09c50ad707 - Trace ID: 740c10a6-c10d-4d3c-b9fa-189cd5ea0b00
Error getting the secret: invalid_client: 7000222 - [2026-07-12 10:22:09Z]: 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: 5482bfa0-ffaf-4322-b9ac-78aa03050500 Correlation ID: 7278d243-e396-4b87-89ff-970aff43ecbc Timestamp: 2026-07-12 10:22:09Z - Correlation ID: 7278d243-e396-4b87-89ff-970aff43ecbc - Trace ID: 5482bfa0-ffaf-4322-b9ac-78aa03050500
Error getting the secret: invalid_client: 7000222 - [2026-07-12 10:22:10Z]: 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: a9565611-813a-4492-a268-4720ed4d0c00 Correlation ID: 7ac5bfb8-8707-4c2f-8217-89e0f8236979 Timestamp: 2026-07-12 10:22:10Z - Correlation ID: 7ac5bfb8-8707-4c2f-8217-89e0f8236979 - Trace ID: a9565611-813a-4492-a268-4720ed4d0c00
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)