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-13 02:22:17Z]: 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: 61b8190f-a51e-486d-ad68-11bc94b42000 Correlation ID: aa987400-1314-4f46-bc62-343dbc7df5df Timestamp: 2026-07-13 02:22:17Z - Correlation ID: aa987400-1314-4f46-bc62-343dbc7df5df - Trace ID: 61b8190f-a51e-486d-ad68-11bc94b42000
(node:5832) [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-13 02:22:18Z]: 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: 577c4aea-5dfb-4894-b5d6-3a5f069a0f00 Correlation ID: 6115be31-4927-47b6-81a5-c3b3bcf4b7f0 Timestamp: 2026-07-13 02:22:18Z - Correlation ID: 6115be31-4927-47b6-81a5-c3b3bcf4b7f0 - Trace ID: 577c4aea-5dfb-4894-b5d6-3a5f069a0f00
Error getting the secret: invalid_client: 7000222 - [2026-07-13 02:22:18Z]: 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: cdbc9d56-79ba-433f-9c0c-582a064f1200 Correlation ID: e3d96404-f7d2-4dbe-af64-334c926f458a Timestamp: 2026-07-13 02:22:18Z - Correlation ID: e3d96404-f7d2-4dbe-af64-334c926f458a - Trace ID: cdbc9d56-79ba-433f-9c0c-582a064f1200
Error getting the secret: invalid_client: 7000222 - [2026-07-13 02:22:18Z]: 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: 4fe94bc5-877b-4f8d-8902-4cc14c6c1200 Correlation ID: e624c4f7-6df5-499d-9ce0-3978a1ee5835 Timestamp: 2026-07-13 02:22:18Z - Correlation ID: e624c4f7-6df5-499d-9ce0-3978a1ee5835 - Trace ID: 4fe94bc5-877b-4f8d-8902-4cc14c6c1200
Error getting the secret: invalid_client: 7000222 - [2026-07-13 02:22:18Z]: 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: cdbc9d56-79ba-433f-9c0c-582a0a4f1200 Correlation ID: 84698c06-8ae7-4d2b-891d-2cc6bf0e6f3c Timestamp: 2026-07-13 02:22:18Z - Correlation ID: 84698c06-8ae7-4d2b-891d-2cc6bf0e6f3c - Trace ID: cdbc9d56-79ba-433f-9c0c-582a0a4f1200
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)