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-10-03 11:18:23Z]: 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: ffdb526f-9e61-465b-8612-2ddf9b0f8100 Correlation ID: 33ed5811-714e-4575-9e1d-aad4ba2014ff Timestamp: 2026-10-03 11:18:23Z - Correlation ID: 33ed5811-714e-4575-9e1d-aad4ba2014ff - Trace ID: ffdb526f-9e61-465b-8612-2ddf9b0f8100
(node:4616) [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-10-03 11:18:23Z]: 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: 4aafa5f9-29f0-42ec-b073-bdde22c29b00 Correlation ID: 333e96ff-7a69-4794-9908-caae2a05ef96 Timestamp: 2026-10-03 11:18:23Z - Correlation ID: 333e96ff-7a69-4794-9908-caae2a05ef96 - Trace ID: 4aafa5f9-29f0-42ec-b073-bdde22c29b00
Error getting the secret: invalid_client: 7000222 - [2026-10-03 11:18:23Z]: 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: 4aafa5f9-29f0-42ec-b073-bdde26c29b00 Correlation ID: df41cbd8-0cf7-40f7-93d5-1d64e0d87ac7 Timestamp: 2026-10-03 11:18:23Z - Correlation ID: df41cbd8-0cf7-40f7-93d5-1d64e0d87ac7 - Trace ID: 4aafa5f9-29f0-42ec-b073-bdde26c29b00
Error getting the secret: invalid_client: 7000222 - [2026-10-03 11:18:23Z]: 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: f8434f21-9a94-47de-915a-b47517a39200 Correlation ID: 44d324bd-65e9-492f-9fe1-0c46f87c5bc1 Timestamp: 2026-10-03 11:18:23Z - Correlation ID: 44d324bd-65e9-492f-9fe1-0c46f87c5bc1 - Trace ID: f8434f21-9a94-47de-915a-b47517a39200
Error getting the secret: invalid_client: 7000222 - [2026-10-03 11:18:23Z]: 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: 1c27b533-468b-475a-b595-d129d2607c00 Correlation ID: eddd47d5-8da6-4b26-a33f-cc89687a5a55 Timestamp: 2026-10-03 11:18:23Z - Correlation ID: eddd47d5-8da6-4b26-a33f-cc89687a5a55 - Trace ID: 1c27b533-468b-475a-b595-d129d2607c00
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)