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-05 23:41: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: 5e5c152f-d6f3-4db9-be08-4d9dd4541f00 Correlation ID: b24205be-7874-47c7-8414-8303b4acb66e Timestamp: 2026-07-05 23:41:52Z - Correlation ID: b24205be-7874-47c7-8414-8303b4acb66e - Trace ID: 5e5c152f-d6f3-4db9-be08-4d9dd4541f00
(node:896) [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-05 23:41: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: 1fc72459-87b9-4362-af98-fdcc7d572e00 Correlation ID: c9837a1e-4eb4-4b05-a379-bfafb350f557 Timestamp: 2026-07-05 23:41:52Z - Correlation ID: c9837a1e-4eb4-4b05-a379-bfafb350f557 - Trace ID: 1fc72459-87b9-4362-af98-fdcc7d572e00
Error getting the secret: invalid_client: 7000222 - [2026-07-05 23:41: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: 54a32943-73a4-453c-b6b1-1949b6a22000 Correlation ID: e7853e32-c73d-4301-830a-b939c7051518 Timestamp: 2026-07-05 23:41:53Z - Correlation ID: e7853e32-c73d-4301-830a-b939c7051518 - Trace ID: 54a32943-73a4-453c-b6b1-1949b6a22000
Error getting the secret: invalid_client: 7000222 - [2026-07-05 23:41: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: cac5131f-653f-46e6-b73d-60bbab432000 Correlation ID: a7031e37-9fea-46d3-aaa6-6d395149f882 Timestamp: 2026-07-05 23:41:53Z - Correlation ID: a7031e37-9fea-46d3-aaa6-6d395149f882 - Trace ID: cac5131f-653f-46e6-b73d-60bbab432000
Error getting the secret: invalid_client: 7000222 - [2026-07-05 23:41: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: 3830aa6d-655d-435e-a709-68b804612200 Correlation ID: f3fe5ef8-10fb-419f-a09d-478ee19c02ce Timestamp: 2026-07-05 23:41:53Z - Correlation ID: f3fe5ef8-10fb-419f-a09d-478ee19c02ce - Trace ID: 3830aa6d-655d-435e-a709-68b804612200
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)