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-27 12:51:05Z]: 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: be594d38-424d-476d-9897-a0f268d00900 Correlation ID: 6f428948-a43d-457b-bd75-e8c4ec092ebc Timestamp: 2026-07-27 12:51:05Z - Correlation ID: 6f428948-a43d-457b-bd75-e8c4ec092ebc - Trace ID: be594d38-424d-476d-9897-a0f268d00900
(node:544) [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-27 12:51:05Z]: 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: 95ac2883-6683-494e-b2c8-3779c9660b00 Correlation ID: 358248df-2fb7-4d88-b376-828fcd386fe9 Timestamp: 2026-07-27 12:51:05Z - Correlation ID: 358248df-2fb7-4d88-b376-828fcd386fe9 - Trace ID: 95ac2883-6683-494e-b2c8-3779c9660b00
Error getting the secret: invalid_client: 7000222 - [2026-07-27 12:51:05Z]: 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: be594d38-424d-476d-9897-a0f272d00900 Correlation ID: 1b963dd4-e9da-4567-b58f-7094767e8bb5 Timestamp: 2026-07-27 12:51:05Z - Correlation ID: 1b963dd4-e9da-4567-b58f-7094767e8bb5 - Trace ID: be594d38-424d-476d-9897-a0f272d00900
Error getting the secret: invalid_client: 7000222 - [2026-07-27 12:51:05Z]: 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: 216b67bb-0ad2-4ab7-9c55-47df5ed90b00 Correlation ID: f78f0356-fdf7-4d7f-bfaf-77f3635beb72 Timestamp: 2026-07-27 12:51:05Z - Correlation ID: f78f0356-fdf7-4d7f-bfaf-77f3635beb72 - Trace ID: 216b67bb-0ad2-4ab7-9c55-47df5ed90b00
Error getting the secret: invalid_client: 7000222 - [2026-07-27 12:51:05Z]: 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: 36622fef-6695-43aa-8e84-45157e780c00 Correlation ID: 77e91e2a-a5c3-4efe-948f-1deabe66593f Timestamp: 2026-07-27 12:51:05Z - Correlation ID: 77e91e2a-a5c3-4efe-948f-1deabe66593f - Trace ID: 36622fef-6695-43aa-8e84-45157e780c00
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)