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-06-17 19:05:09Z]: 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: bdb49c4f-d214-4bc5-b72c-c48f586d0100 Correlation ID: b49a8f83-1d90-4511-823a-0525d5ef81e8 Timestamp: 2026-06-17 19:05:09Z - Correlation ID: b49a8f83-1d90-4511-823a-0525d5ef81e8 - Trace ID: bdb49c4f-d214-4bc5-b72c-c48f586d0100
(node:1460) [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-06-17 19:05:09Z]: 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: fd41e9e7-575f-4da4-a910-e9d834bf3200 Correlation ID: 2b0752ff-04a4-444e-8a52-7df1d29812f7 Timestamp: 2026-06-17 19:05:09Z - Correlation ID: 2b0752ff-04a4-444e-8a52-7df1d29812f7 - Trace ID: fd41e9e7-575f-4da4-a910-e9d834bf3200
Error getting the secret: invalid_client: 7000222 - [2026-06-17 19:05:10Z]: 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: 74396620-f0bf-473f-836e-0b90996e0100 Correlation ID: f2c03cb9-f96e-4d55-b57a-7d8062f2e0e1 Timestamp: 2026-06-17 19:05:10Z - Correlation ID: f2c03cb9-f96e-4d55-b57a-7d8062f2e0e1 - Trace ID: 74396620-f0bf-473f-836e-0b90996e0100
Error getting the secret: invalid_client: 7000222 - [2026-06-17 19:05:10Z]: 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: 6c86cf7b-8627-41f6-8b7d-c6d3035c2200 Correlation ID: 750f0204-17a3-4832-a949-4fe21ba14033 Timestamp: 2026-06-17 19:05:10Z - Correlation ID: 750f0204-17a3-4832-a949-4fe21ba14033 - Trace ID: 6c86cf7b-8627-41f6-8b7d-c6d3035c2200
Application has thrown an uncaught exception and is terminated:
TypeError: Cannot read properties of undefined (reading 'username')
    at C:\vehicle_status_API\server.js:25:32
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)