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-22 20:13: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: ab6e935f-38b7-4101-a4c8-529fab934400 Correlation ID: 31ee0726-160f-4a2e-a00e-ea23fc91a76b Timestamp: 2026-07-22 20:13:25Z - Correlation ID: 31ee0726-160f-4a2e-a00e-ea23fc91a76b - Trace ID: ab6e935f-38b7-4101-a4c8-529fab934400
(node:5076) [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-22 20:13: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: b2e06c02-28a7-4b29-a617-edc91fb94a00 Correlation ID: 12d9cb4d-c88b-4f49-b185-16a2e240c551 Timestamp: 2026-07-22 20:13:25Z - Correlation ID: 12d9cb4d-c88b-4f49-b185-16a2e240c551 - Trace ID: b2e06c02-28a7-4b29-a617-edc91fb94a00
Error getting the secret: invalid_client: 7000222 - [2026-07-22 20:13: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: d39ad6dd-08f6-413a-b9d2-531472b60800 Correlation ID: 3503d0ea-d959-4ba0-addc-13f7de76dd2c Timestamp: 2026-07-22 20:13:25Z - Correlation ID: 3503d0ea-d959-4ba0-addc-13f7de76dd2c - Trace ID: d39ad6dd-08f6-413a-b9d2-531472b60800
Error getting the secret: invalid_client: 7000222 - [2026-07-22 20:13:26Z]: 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: 961cda65-69aa-416b-b35e-067666a23c00 Correlation ID: 8436575d-3b11-4d7a-a0c5-89ef0085e40f Timestamp: 2026-07-22 20:13:26Z - Correlation ID: 8436575d-3b11-4d7a-a0c5-89ef0085e40f - Trace ID: 961cda65-69aa-416b-b35e-067666a23c00
Error getting the secret: invalid_client: 7000222 - [2026-07-22 20:13:26Z]: 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: a4c088ac-5908-40e3-9c4d-4091e4984b00 Correlation ID: b0a1a36e-08d2-44f9-ae88-e911c4760b4b Timestamp: 2026-07-22 20:13:26Z - Correlation ID: b0a1a36e-08d2-44f9-ae88-e911c4760b4b - Trace ID: a4c088ac-5908-40e3-9c4d-4091e4984b00
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)