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-12 12:48:06Z]: 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: 44aae023-f214-4aad-b271-0c9a725f2000 Correlation ID: aa4c6bf4-b6bc-47ca-972d-8ffd0c313f86 Timestamp: 2026-06-12 12:48:06Z - Correlation ID: aa4c6bf4-b6bc-47ca-972d-8ffd0c313f86 - Trace ID: 44aae023-f214-4aad-b271-0c9a725f2000
(node:4244) [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-12 12:48:07Z]: 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: f30ff597-d343-4f92-be47-da5b36b57d00 Correlation ID: 1ece1be0-034f-4b36-ae6b-07b7c96efdb8 Timestamp: 2026-06-12 12:48:07Z - Correlation ID: 1ece1be0-034f-4b36-ae6b-07b7c96efdb8 - Trace ID: f30ff597-d343-4f92-be47-da5b36b57d00
Error getting the secret: invalid_client: 7000222 - [2026-06-12 12:48:07Z]: 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: 384a0604-8a38-4c0a-a615-55a60ec00e00 Correlation ID: f1b76b60-680d-4c95-9293-d5170147ade7 Timestamp: 2026-06-12 12:48:07Z - Correlation ID: f1b76b60-680d-4c95-9293-d5170147ade7 - Trace ID: 384a0604-8a38-4c0a-a615-55a60ec00e00
Error getting the secret: invalid_client: 7000222 - [2026-06-12 12:48:07Z]: 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: c61f2e70-9451-4760-88d1-9cb126c04800 Correlation ID: 42fe0846-37d6-4977-bad6-a47c87949ec4 Timestamp: 2026-06-12 12:48:07Z - Correlation ID: 42fe0846-37d6-4977-bad6-a47c87949ec4 - Trace ID: c61f2e70-9451-4760-88d1-9cb126c04800
Error getting the secret: invalid_client: 7000222 - [2026-06-12 12:48:07Z]: 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: 0b8ff9e2-8088-463d-ad98-3bf5d3ed0d00 Correlation ID: 778e948f-644a-4275-b36d-2513d3dabf8c Timestamp: 2026-06-12 12:48:07Z - Correlation ID: 778e948f-644a-4275-b36d-2513d3dabf8c - Trace ID: 0b8ff9e2-8088-463d-ad98-3bf5d3ed0d00
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)