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-04-25 23:17:30Z]: 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: b4b00ee6-b88a-42f7-97d7-d8dd23ff1800 Correlation ID: 93ab9f10-1c48-43a2-b710-8f94b9ed6151 Timestamp: 2026-04-25 23:17:30Z - Correlation ID: 93ab9f10-1c48-43a2-b710-8f94b9ed6151 - Trace ID: b4b00ee6-b88a-42f7-97d7-d8dd23ff1800
(node:5520) [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-04-25 23:17:30Z]: 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: f601c7b4-3645-4783-9471-73d902021c00 Correlation ID: 534941b2-572c-484c-992d-0e4fdf570345 Timestamp: 2026-04-25 23:17:30Z - Correlation ID: 534941b2-572c-484c-992d-0e4fdf570345 - Trace ID: f601c7b4-3645-4783-9471-73d902021c00
Error getting the secret: invalid_client: 7000222 - [2026-04-25 23:17:31Z]: 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: e0946b2d-9b7b-42ce-92d1-10334bdf1900 Correlation ID: 68b1aa8f-2399-4210-af5b-b5fe946a3f87 Timestamp: 2026-04-25 23:17:31Z - Correlation ID: 68b1aa8f-2399-4210-af5b-b5fe946a3f87 - Trace ID: e0946b2d-9b7b-42ce-92d1-10334bdf1900
Error getting the secret: invalid_client: 7000222 - [2026-04-25 23:17:31Z]: 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: bf8a69ae-7943-4a4b-96f9-be07caa51a00 Correlation ID: e5c0d4ec-56c6-4e91-a3aa-71ab82bbd3b5 Timestamp: 2026-04-25 23:17:31Z - Correlation ID: e5c0d4ec-56c6-4e91-a3aa-71ab82bbd3b5 - Trace ID: bf8a69ae-7943-4a4b-96f9-be07caa51a00
Error getting the secret: invalid_client: 7000222 - [2026-04-25 23:17: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: 8b874287-7e7d-4304-82c4-5ba46e4a1600 Correlation ID: ef6f239a-8019-4a9e-b899-3c0653e93d9b Timestamp: 2026-04-25 23:17:32Z - Correlation ID: ef6f239a-8019-4a9e-b899-3c0653e93d9b - Trace ID: 8b874287-7e7d-4304-82c4-5ba46e4a1600
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)