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-15 21:26:26Z]: 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: 87d21706-715a-48a1-800e-258e074d2000 Correlation ID: df4ec094-8f24-4287-a176-6d93f967d099 Timestamp: 2026-07-15 21:26:26Z - Correlation ID: df4ec094-8f24-4287-a176-6d93f967d099 - Trace ID: 87d21706-715a-48a1-800e-258e074d2000
(node:4784) [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-15 21:26:27Z]: 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: 1f6030f6-eaec-4003-a68f-fc3276061f00 Correlation ID: 3297b3ec-2a65-46d2-a746-a8af78f02dfd Timestamp: 2026-07-15 21:26:27Z - Correlation ID: 3297b3ec-2a65-46d2-a746-a8af78f02dfd - Trace ID: 1f6030f6-eaec-4003-a68f-fc3276061f00
Error getting the secret: invalid_client: 7000222 - [2026-07-15 21:26:27Z]: 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: 2b0fd0eb-9959-4862-96d9-519070542100 Correlation ID: 9e828ea5-62f9-4614-b2b6-ed3b8afb74bc Timestamp: 2026-07-15 21:26:27Z - Correlation ID: 9e828ea5-62f9-4614-b2b6-ed3b8afb74bc - Trace ID: 2b0fd0eb-9959-4862-96d9-519070542100
Error getting the secret: invalid_client: 7000222 - [2026-07-15 21:26:27Z]: 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: 87d21706-715a-48a1-800e-258e1e4d2000 Correlation ID: c9214a93-7826-46fd-9643-c0f7786e7ceb Timestamp: 2026-07-15 21:26:27Z - Correlation ID: c9214a93-7826-46fd-9643-c0f7786e7ceb - Trace ID: 87d21706-715a-48a1-800e-258e1e4d2000
Error getting the secret: invalid_client: 7000222 - [2026-07-15 21:26:28Z]: 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: e2aa2cba-b374-4770-b4ee-273d47ff3600 Correlation ID: aac558a4-5bae-479a-b313-197c00874feb Timestamp: 2026-07-15 21:26:28Z - Correlation ID: aac558a4-5bae-479a-b313-197c00874feb - Trace ID: e2aa2cba-b374-4770-b4ee-273d47ff3600
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)