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-19 21:40: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: 243ab39c-7133-4aa2-a23a-3a5991041c00 Correlation ID: 1ad98553-c194-46ec-ac13-15a1cd018dcf Timestamp: 2026-07-19 21:40:25Z - Correlation ID: 1ad98553-c194-46ec-ac13-15a1cd018dcf - Trace ID: 243ab39c-7133-4aa2-a23a-3a5991041c00
(node:3536) [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-19 21:40: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: c7592d3c-7708-4df5-84e8-620767db1d00 Correlation ID: c289ae76-c75b-4204-9c3c-c2ce50503ea2 Timestamp: 2026-07-19 21:40:25Z - Correlation ID: c289ae76-c75b-4204-9c3c-c2ce50503ea2 - Trace ID: c7592d3c-7708-4df5-84e8-620767db1d00
Error getting the secret: invalid_client: 7000222 - [2026-07-19 21:40: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: 778b4e0b-f527-4259-8b76-77aba3211600 Correlation ID: 94d97a55-f5e7-4126-8125-be2e1454a547 Timestamp: 2026-07-19 21:40:26Z - Correlation ID: 94d97a55-f5e7-4126-8125-be2e1454a547 - Trace ID: 778b4e0b-f527-4259-8b76-77aba3211600
Error getting the secret: invalid_client: 7000222 - [2026-07-19 21:40: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: 71c732e2-9869-42ec-aed8-174a8efd1a00 Correlation ID: d283b4d6-bd70-4332-9c16-8f141173a52a Timestamp: 2026-07-19 21:40:26Z - Correlation ID: d283b4d6-bd70-4332-9c16-8f141173a52a - Trace ID: 71c732e2-9869-42ec-aed8-174a8efd1a00
Error getting the secret: invalid_client: 7000222 - [2026-07-19 21:40: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: 243ab39c-7133-4aa2-a23a-3a5999041c00 Correlation ID: 0bfefa08-df40-40e7-bbaa-8af453ad0827 Timestamp: 2026-07-19 21:40:26Z - Correlation ID: 0bfefa08-df40-40e7-bbaa-8af453ad0827 - Trace ID: 243ab39c-7133-4aa2-a23a-3a5999041c00
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)