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-12 14:24:56Z]: 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: de730dd9-9ffc-4476-ba0f-eb6cc9620200 Correlation ID: 0576230c-89aa-4c1a-a6de-c0547c8f42b2 Timestamp: 2026-07-12 14:24:56Z - Correlation ID: 0576230c-89aa-4c1a-a6de-c0547c8f42b2 - Trace ID: de730dd9-9ffc-4476-ba0f-eb6cc9620200
(node:956) [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-12 14:24:56Z]: 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: 02d2c40b-4d82-469c-b596-712730650700 Correlation ID: db57c413-9a32-44f1-9296-27106feabe0c Timestamp: 2026-07-12 14:24:56Z - Correlation ID: db57c413-9a32-44f1-9296-27106feabe0c - Trace ID: 02d2c40b-4d82-469c-b596-712730650700
Error getting the secret: invalid_client: 7000222 - [2026-07-12 14:24:56Z]: 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: 6cacf65f-319d-4580-bdc3-68ee3aeb0b00 Correlation ID: eefe2021-583e-4eea-8ba4-1b770eddf5d8 Timestamp: 2026-07-12 14:24:56Z - Correlation ID: eefe2021-583e-4eea-8ba4-1b770eddf5d8 - Trace ID: 6cacf65f-319d-4580-bdc3-68ee3aeb0b00
Error getting the secret: invalid_client: 7000222 - [2026-07-12 14:24:57Z]: 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: 71dc4ea0-f822-4b9b-b0c9-9523ad640800 Correlation ID: 7a3e2eda-c9de-4e5c-90ee-38b0a31cac70 Timestamp: 2026-07-12 14:24:57Z - Correlation ID: 7a3e2eda-c9de-4e5c-90ee-38b0a31cac70 - Trace ID: 71dc4ea0-f822-4b9b-b0c9-9523ad640800
Error getting the secret: invalid_client: 7000222 - [2026-07-12 14:24:57Z]: 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: 02d2c40b-4d82-469c-b596-712737650700 Correlation ID: 7d821eac-0530-4578-ad19-3ba0f8e2b4ec Timestamp: 2026-07-12 14:24:57Z - Correlation ID: 7d821eac-0530-4578-ad19-3ba0f8e2b4ec - Trace ID: 02d2c40b-4d82-469c-b596-712737650700
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)