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-14 07:26:50Z]: 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: f1a0dc73-ccdb-4d4a-8c20-6eadf1360a00 Correlation ID: dab92866-361b-48da-93ed-bcd114ddde2e Timestamp: 2026-07-14 07:26:50Z - Correlation ID: dab92866-361b-48da-93ed-bcd114ddde2e - Trace ID: f1a0dc73-ccdb-4d4a-8c20-6eadf1360a00
(node:512) [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-14 07:26:51Z]: 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: 3f9c5425-fc13-4606-aaf3-8d21ea5b2600 Correlation ID: 06a55098-5cfc-4b9f-a06c-a837dd35d13b Timestamp: 2026-07-14 07:26:51Z - Correlation ID: 06a55098-5cfc-4b9f-a06c-a837dd35d13b - Trace ID: 3f9c5425-fc13-4606-aaf3-8d21ea5b2600
Error getting the secret: invalid_client: 7000222 - [2026-07-14 07:26:51Z]: 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: 78b9d368-c40f-4598-8b9f-ff37e8593300 Correlation ID: 0d6099bc-8879-4554-a9ea-0eb6bdb4ada1 Timestamp: 2026-07-14 07:26:51Z - Correlation ID: 0d6099bc-8879-4554-a9ea-0eb6bdb4ada1 - Trace ID: 78b9d368-c40f-4598-8b9f-ff37e8593300
Error getting the secret: invalid_client: 7000222 - [2026-07-14 07:26:51Z]: 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: 3f9c5425-fc13-4606-aaf3-8d21f15b2600 Correlation ID: ac575d9f-6df9-48a1-bed6-956ccb50cc18 Timestamp: 2026-07-14 07:26:51Z - Correlation ID: ac575d9f-6df9-48a1-bed6-956ccb50cc18 - Trace ID: 3f9c5425-fc13-4606-aaf3-8d21f15b2600
Error getting the secret: invalid_client: 7000222 - [2026-07-14 07:26:51Z]: 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: bd8e59f7-1d76-4337-ac7e-4642a09d3200 Correlation ID: dfdd8748-85e2-41f4-a28e-6382f75e8c81 Timestamp: 2026-07-14 07:26:51Z - Correlation ID: dfdd8748-85e2-41f4-a28e-6382f75e8c81 - Trace ID: bd8e59f7-1d76-4337-ac7e-4642a09d3200
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)