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-03 13:39:39Z]: 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: c16e41b0-85e8-4d42-9889-c3af55de0200 Correlation ID: 20d0ffe7-4357-4312-9a94-98123ed25df9 Timestamp: 2026-07-03 13:39:39Z - Correlation ID: 20d0ffe7-4357-4312-9a94-98123ed25df9 - Trace ID: c16e41b0-85e8-4d42-9889-c3af55de0200
(node:4380) [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-03 13:39:39Z]: 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: e9907e9d-b796-4fe0-b0ca-cab72f073300 Correlation ID: f911773d-12db-41f7-88b6-6474f9ebf73c Timestamp: 2026-07-03 13:39:39Z - Correlation ID: f911773d-12db-41f7-88b6-6474f9ebf73c - Trace ID: e9907e9d-b796-4fe0-b0ca-cab72f073300
Error getting the secret: invalid_client: 7000222 - [2026-07-03 13:39:39Z]: 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: 31ce748e-43fb-4a2a-918b-f09a2d7eb000 Correlation ID: 41b5442a-f0fa-4ba4-93a4-bbe53c4dd522 Timestamp: 2026-07-03 13:39:39Z - Correlation ID: 41b5442a-f0fa-4ba4-93a4-bbe53c4dd522 - Trace ID: 31ce748e-43fb-4a2a-918b-f09a2d7eb000
Error getting the secret: invalid_client: 7000222 - [2026-07-03 13:39:40Z]: 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: 73e4661e-97fa-40c7-8ec1-3e71cfe04000 Correlation ID: 6b95a80d-3f4c-4b3e-8024-26d976917cf5 Timestamp: 2026-07-03 13:39:40Z - Correlation ID: 6b95a80d-3f4c-4b3e-8024-26d976917cf5 - Trace ID: 73e4661e-97fa-40c7-8ec1-3e71cfe04000
Error getting the secret: invalid_client: 7000222 - [2026-07-03 13:39:40Z]: 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: 6cb4e468-31a6-4f65-b0f9-954a77555200 Correlation ID: 9ce422e1-cc68-4448-a8b8-fc8b0de3dc27 Timestamp: 2026-07-03 13:39:40Z - Correlation ID: 9ce422e1-cc68-4448-a8b8-fc8b0de3dc27 - Trace ID: 6cb4e468-31a6-4f65-b0f9-954a77555200
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)