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-07 01:31:11Z]: 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: 10f568fc-05c4-4f3e-b93d-8037bc2f2d00 Correlation ID: d22b926b-b51b-4a78-9601-975eed9429f3 Timestamp: 2026-07-07 01:31:11Z - Correlation ID: d22b926b-b51b-4a78-9601-975eed9429f3 - Trace ID: 10f568fc-05c4-4f3e-b93d-8037bc2f2d00
(node:2520) [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-07 01:31:11Z]: 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: c629f90a-d61a-48f9-bdae-b72fcc3b3000 Correlation ID: eb9da286-4dd6-499a-9f8c-24cc295981ff Timestamp: 2026-07-07 01:31:11Z - Correlation ID: eb9da286-4dd6-499a-9f8c-24cc295981ff - Trace ID: c629f90a-d61a-48f9-bdae-b72fcc3b3000
Error getting the secret: invalid_client: 7000222 - [2026-07-07 01:31:11Z]: 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: db827b52-0788-4a41-bbfd-e44dd8784600 Correlation ID: 5bfbb52b-de06-480d-952a-8bf31c070cd3 Timestamp: 2026-07-07 01:31:11Z - Correlation ID: 5bfbb52b-de06-480d-952a-8bf31c070cd3 - Trace ID: db827b52-0788-4a41-bbfd-e44dd8784600
Error getting the secret: invalid_client: 7000222 - [2026-07-07 01:31:11Z]: 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: c629f90a-d61a-48f9-bdae-b72fd63b3000 Correlation ID: 758fe12f-dd5d-40c5-a86e-b04d49f1b4e5 Timestamp: 2026-07-07 01:31:11Z - Correlation ID: 758fe12f-dd5d-40c5-a86e-b04d49f1b4e5 - Trace ID: c629f90a-d61a-48f9-bdae-b72fd63b3000
Error getting the secret: invalid_client: 7000222 - [2026-07-07 01:31:11Z]: 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: c629f90a-d61a-48f9-bdae-b72fdb3b3000 Correlation ID: 3db5defb-4165-409f-96d3-8bdc036a818b Timestamp: 2026-07-07 01:31:11Z - Correlation ID: 3db5defb-4165-409f-96d3-8bdc036a818b - Trace ID: c629f90a-d61a-48f9-bdae-b72fdb3b3000
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)