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-16 17:28:25Z]: 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: 4b497bb1-4ec2-4b7f-ada0-bdebe4963100 Correlation ID: 3be0bd08-2ce1-4d20-a641-a9b0f299ff4c Timestamp: 2026-07-16 17:28:25Z - Correlation ID: 3be0bd08-2ce1-4d20-a641-a9b0f299ff4c - Trace ID: 4b497bb1-4ec2-4b7f-ada0-bdebe4963100
(node:3984) [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-16 17:28:25Z]: 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: 72b79d51-5b8c-4d16-b43a-d49d7ee43100 Correlation ID: 41d93569-3455-4980-b8ba-479a973a6a9c Timestamp: 2026-07-16 17:28:25Z - Correlation ID: 41d93569-3455-4980-b8ba-479a973a6a9c - Trace ID: 72b79d51-5b8c-4d16-b43a-d49d7ee43100
Error getting the secret: invalid_client: 7000222 - [2026-07-16 17:28:25Z]: 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: 210457d8-391d-471b-b2ca-43f3f9033500 Correlation ID: b9eaa263-1e94-491e-9d4e-f45b82e367d2 Timestamp: 2026-07-16 17:28:25Z - Correlation ID: b9eaa263-1e94-491e-9d4e-f45b82e367d2 - Trace ID: 210457d8-391d-471b-b2ca-43f3f9033500
Error getting the secret: invalid_client: 7000222 - [2026-07-16 17:28:25Z]: 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: ea5bf5be-1442-47e0-95b3-f720d3932900 Correlation ID: dc6bffc9-2a6f-43c7-a6b6-1c827e81a5af Timestamp: 2026-07-16 17:28:25Z - Correlation ID: dc6bffc9-2a6f-43c7-a6b6-1c827e81a5af - Trace ID: ea5bf5be-1442-47e0-95b3-f720d3932900
Error getting the secret: invalid_client: 7000222 - [2026-07-16 17:28:25Z]: 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: 193953e7-b172-42ed-a99e-513eef680c00 Correlation ID: 1cf2ad7e-e190-4f34-9db3-8db4571c60ce Timestamp: 2026-07-16 17:28:25Z - Correlation ID: 1cf2ad7e-e190-4f34-9db3-8db4571c60ce - Trace ID: 193953e7-b172-42ed-a99e-513eef680c00
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)