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-10 17:30: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: 69b801bc-5238-4303-a4a1-0a68e8293700 Correlation ID: 3dc75bdb-11c4-4cc6-b1ef-c137c5884e0d Timestamp: 2026-07-10 17:30:06Z - Correlation ID: 3dc75bdb-11c4-4cc6-b1ef-c137c5884e0d - Trace ID: 69b801bc-5238-4303-a4a1-0a68e8293700
(node:5712) [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-10 17:30: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: 9f3ac628-528b-4cda-ade2-a9be43fbac00 Correlation ID: ccfafb7c-6a93-4b37-a6c0-996967149ebe Timestamp: 2026-07-10 17:30:06Z - Correlation ID: ccfafb7c-6a93-4b37-a6c0-996967149ebe - Trace ID: 9f3ac628-528b-4cda-ade2-a9be43fbac00
Error getting the secret: invalid_client: 7000222 - [2026-07-10 17:30:07Z]: 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: f160a409-218b-4faa-85e0-bea028c43d00 Correlation ID: c46abe44-7d58-453f-b664-87e6024f6e5a Timestamp: 2026-07-10 17:30:07Z - Correlation ID: c46abe44-7d58-453f-b664-87e6024f6e5a - Trace ID: f160a409-218b-4faa-85e0-bea028c43d00
Error getting the secret: invalid_client: 7000222 - [2026-07-10 17:30:07Z]: 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: c3be2a42-9d22-4f5d-9e6b-fa381cf2b700 Correlation ID: 11f2f321-47d3-4247-b491-5522a553efd2 Timestamp: 2026-07-10 17:30:07Z - Correlation ID: 11f2f321-47d3-4247-b491-5522a553efd2 - Trace ID: c3be2a42-9d22-4f5d-9e6b-fa381cf2b700
Error getting the secret: invalid_client: 7000222 - [2026-07-10 17:30: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: 9c8173bf-eefa-4bb7-b069-2c88426b2900 Correlation ID: 72b33448-0794-48b1-aa94-27de3e6e2f7e Timestamp: 2026-07-10 17:30:08Z - Correlation ID: 72b33448-0794-48b1-aa94-27de3e6e2f7e - Trace ID: 9c8173bf-eefa-4bb7-b069-2c88426b2900
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)