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-14 09:14:58Z]: 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: bec672c5-7f4b-4754-97b8-ded721043200 Correlation ID: 2e0145d6-2cc1-46e4-b6c5-6a67df0e35f6 Timestamp: 2026-07-14 09:14:58Z - Correlation ID: 2e0145d6-2cc1-46e4-b6c5-6a67df0e35f6 - Trace ID: bec672c5-7f4b-4754-97b8-ded721043200
(node:1008) [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-14 09:14:59Z]: 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: 9ddd7e26-8322-4eff-8ca8-4fcb9fea3a00 Correlation ID: 223ac903-e6f6-4f4d-9843-99c66ecef4ec Timestamp: 2026-07-14 09:14:59Z - Correlation ID: 223ac903-e6f6-4f4d-9843-99c66ecef4ec - Trace ID: 9ddd7e26-8322-4eff-8ca8-4fcb9fea3a00
Error getting the secret: invalid_client: 7000222 - [2026-07-14 09:14:59Z]: 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: bec672c5-7f4b-4754-97b8-ded72f043200 Correlation ID: 9bd0a7d1-3d82-4d03-82c9-3d62fdf82f42 Timestamp: 2026-07-14 09:14:59Z - Correlation ID: 9bd0a7d1-3d82-4d03-82c9-3d62fdf82f42 - Trace ID: bec672c5-7f4b-4754-97b8-ded72f043200
Error getting the secret: invalid_client: 7000222 - [2026-07-14 09:14:59Z]: 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: 41ed5600-8002-405b-9640-1dc58c450d00 Correlation ID: 2c78ff7f-a28f-4b87-b03f-52ceb3777e16 Timestamp: 2026-07-14 09:14:59Z - Correlation ID: 2c78ff7f-a28f-4b87-b03f-52ceb3777e16 - Trace ID: 41ed5600-8002-405b-9640-1dc58c450d00
Error getting the secret: invalid_client: 7000222 - [2026-07-14 09:15:00Z]: 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: c8c6a9e4-283c-4c04-a0f5-e63d79e20d00 Correlation ID: a1ba0e5c-c2ed-48db-ac66-07f180ae23c6 Timestamp: 2026-07-14 09:15:00Z - Correlation ID: a1ba0e5c-c2ed-48db-ac66-07f180ae23c6 - Trace ID: c8c6a9e4-283c-4c04-a0f5-e63d79e20d00
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)