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-13 12:37:32Z]: 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: 3e46d8f1-501d-4d7f-b16d-692d28f11200 Correlation ID: 1b4c97d1-de89-42d6-a544-939d8d1515d5 Timestamp: 2026-07-13 12:37:32Z - Correlation ID: 1b4c97d1-de89-42d6-a544-939d8d1515d5 - Trace ID: 3e46d8f1-501d-4d7f-b16d-692d28f11200
(node:4720) [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-13 12:37:32Z]: 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: cc6514d2-9a18-4fb2-9dc2-ad1ae2130700 Correlation ID: 19e4cced-6f33-4d0d-8f69-71caeb74a5b2 Timestamp: 2026-07-13 12:37:32Z - Correlation ID: 19e4cced-6f33-4d0d-8f69-71caeb74a5b2 - Trace ID: cc6514d2-9a18-4fb2-9dc2-ad1ae2130700
Error getting the secret: invalid_client: 7000222 - [2026-07-13 12:37:33Z]: 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: ff4c07b1-9114-4724-b9d6-d32fd4491700 Correlation ID: d60dc969-e14f-419e-a5ce-f03d33d034f3 Timestamp: 2026-07-13 12:37:33Z - Correlation ID: d60dc969-e14f-419e-a5ce-f03d33d034f3 - Trace ID: ff4c07b1-9114-4724-b9d6-d32fd4491700
Error getting the secret: invalid_client: 7000222 - [2026-07-13 12:37:33Z]: 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: 2ea26926-f150-4de0-8a3f-30396c550d00 Correlation ID: 3093cded-14df-4bfd-a574-f298f5e8c2c4 Timestamp: 2026-07-13 12:37:33Z - Correlation ID: 3093cded-14df-4bfd-a574-f298f5e8c2c4 - Trace ID: 2ea26926-f150-4de0-8a3f-30396c550d00
Error getting the secret: invalid_client: 7000222 - [2026-07-13 12:37:34Z]: 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: 6619ac38-23ec-44b1-b22a-08677fea0b00 Correlation ID: d5ecb416-7aa0-4d7a-8442-fcceea92e67b Timestamp: 2026-07-13 12:37:34Z - Correlation ID: d5ecb416-7aa0-4d7a-8442-fcceea92e67b - Trace ID: 6619ac38-23ec-44b1-b22a-08677fea0b00
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)