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-20 09:46:35Z]: 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: 530160f6-af1c-4372-90dc-5cdc0fdb0800 Correlation ID: 28858836-ddb7-48df-8f2a-830b8dc31f55 Timestamp: 2026-07-20 09:46:35Z - Correlation ID: 28858836-ddb7-48df-8f2a-830b8dc31f55 - Trace ID: 530160f6-af1c-4372-90dc-5cdc0fdb0800
(node:844) [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-20 09:46:35Z]: 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: d85b67f7-ad21-4ce8-a551-5253affd2400 Correlation ID: 157fb29d-6cae-44df-aef0-64b11f1a209a Timestamp: 2026-07-20 09:46:35Z - Correlation ID: 157fb29d-6cae-44df-aef0-64b11f1a209a - Trace ID: d85b67f7-ad21-4ce8-a551-5253affd2400
Error getting the secret: invalid_client: 7000222 - [2026-07-20 09:46:36Z]: 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: 98130be0-44ca-471b-acd3-545f4ac02700 Correlation ID: 9b74dbd2-e023-43fe-92ff-c88b68a25e65 Timestamp: 2026-07-20 09:46:36Z - Correlation ID: 9b74dbd2-e023-43fe-92ff-c88b68a25e65 - Trace ID: 98130be0-44ca-471b-acd3-545f4ac02700
Error getting the secret: invalid_client: 7000222 - [2026-07-20 09:46:36Z]: 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: d85b67f7-ad21-4ce8-a551-5253b4fd2400 Correlation ID: 87d65b2a-bebf-4617-b2bb-845687a67df8 Timestamp: 2026-07-20 09:46:36Z - Correlation ID: 87d65b2a-bebf-4617-b2bb-845687a67df8 - Trace ID: d85b67f7-ad21-4ce8-a551-5253b4fd2400
Error getting the secret: invalid_client: 7000222 - [2026-07-20 09:46:36Z]: 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: 13ec746a-ac29-44ed-a1e7-5edd3b140200 Correlation ID: 4bb8861e-2c47-498a-9187-73c58d96fdea Timestamp: 2026-07-20 09:46:36Z - Correlation ID: 4bb8861e-2c47-498a-9187-73c58d96fdea - Trace ID: 13ec746a-ac29-44ed-a1e7-5edd3b140200
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)