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-05 19:18:55Z]: 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: 74ce8d43-f5ae-4cd0-9d8a-303a87a11d00 Correlation ID: 8a3207d6-329d-44d4-a3d1-259f21f3f612 Timestamp: 2026-07-05 19:18:55Z - Correlation ID: 8a3207d6-329d-44d4-a3d1-259f21f3f612 - Trace ID: 74ce8d43-f5ae-4cd0-9d8a-303a87a11d00
(node:2632) [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-05 19:18:56Z]: 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: e1938e9b-0c2c-467e-85be-ccbf580d2300 Correlation ID: b2c403fb-2f85-427f-b07f-456c2b9f0574 Timestamp: 2026-07-05 19:18:56Z - Correlation ID: b2c403fb-2f85-427f-b07f-456c2b9f0574 - Trace ID: e1938e9b-0c2c-467e-85be-ccbf580d2300
Error getting the secret: invalid_client: 7000222 - [2026-07-05 19:18:56Z]: 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: f8534b88-1a29-4636-a7a0-287df6e31e00 Correlation ID: 3dad1b9b-da07-4af5-9bfa-1c4cd054f6c4 Timestamp: 2026-07-05 19:18:56Z - Correlation ID: 3dad1b9b-da07-4af5-9bfa-1c4cd054f6c4 - Trace ID: f8534b88-1a29-4636-a7a0-287df6e31e00
Error getting the secret: invalid_client: 7000222 - [2026-07-05 19:18:56Z]: 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: fbeeeacb-987f-4290-ab94-20f41af41d00 Correlation ID: d73042a6-1e0e-4764-80b8-46bb76c1466d Timestamp: 2026-07-05 19:18:56Z - Correlation ID: d73042a6-1e0e-4764-80b8-46bb76c1466d - Trace ID: fbeeeacb-987f-4290-ab94-20f41af41d00
Error getting the secret: invalid_client: 7000222 - [2026-07-05 19:18:57Z]: 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: 1c170d3b-7471-496c-b053-6810f8612d00 Correlation ID: ded1a762-b990-4237-9de7-c4112b2ce8da Timestamp: 2026-07-05 19:18:57Z - Correlation ID: ded1a762-b990-4237-9de7-c4112b2ce8da - Trace ID: 1c170d3b-7471-496c-b053-6810f8612d00
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)