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-21 22:44:07Z]: 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: 3642fd4e-cc4c-4097-afb1-72b9ac7b1400 Correlation ID: 69c00338-4663-40a0-b209-2c003f1b9df0 Timestamp: 2026-07-21 22:44:07Z - Correlation ID: 69c00338-4663-40a0-b209-2c003f1b9df0 - Trace ID: 3642fd4e-cc4c-4097-afb1-72b9ac7b1400
(node:4480) [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-21 22:44:07Z]: 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: e9884e64-93ba-4a0e-9909-dcc3be2d3800 Correlation ID: 57b558ff-a776-459e-bc32-26c4b3a98cd0 Timestamp: 2026-07-21 22:44:07Z - Correlation ID: 57b558ff-a776-459e-bc32-26c4b3a98cd0 - Trace ID: e9884e64-93ba-4a0e-9909-dcc3be2d3800
Error getting the secret: invalid_client: 7000222 - [2026-07-21 22:44:08Z]: 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: 51baa31a-7aa2-48a0-857b-7e6af29a2100 Correlation ID: 0b19cadd-b34b-4ed2-8fe4-8b7176269728 Timestamp: 2026-07-21 22:44:08Z - Correlation ID: 0b19cadd-b34b-4ed2-8fe4-8b7176269728 - Trace ID: 51baa31a-7aa2-48a0-857b-7e6af29a2100
Error getting the secret: invalid_client: 7000222 - [2026-07-21 22:44:08Z]: 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: 3642fd4e-cc4c-4097-afb1-72b9ca7b1400 Correlation ID: 4c21cdc3-b7f8-495d-b3d4-86231bb10629 Timestamp: 2026-07-21 22:44:08Z - Correlation ID: 4c21cdc3-b7f8-495d-b3d4-86231bb10629 - Trace ID: 3642fd4e-cc4c-4097-afb1-72b9ca7b1400
Error getting the secret: invalid_client: 7000222 - [2026-07-21 22:44:08Z]: 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: cb559509-4ddc-4858-8e64-bee43d1e1d00 Correlation ID: 74a6cc5f-2a79-4418-bc55-b151905600a3 Timestamp: 2026-07-21 22:44:08Z - Correlation ID: 74a6cc5f-2a79-4418-bc55-b151905600a3 - Trace ID: cb559509-4ddc-4858-8e64-bee43d1e1d00
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)