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-03 07:32: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: e8727634-6e9c-4b34-9848-7fd3a46d2400 Correlation ID: e6709a02-7cfd-45e3-b5e0-eaafac2645fb Timestamp: 2026-07-03 07:32:31Z - Correlation ID: e6709a02-7cfd-45e3-b5e0-eaafac2645fb - Trace ID: e8727634-6e9c-4b34-9848-7fd3a46d2400
(node:376) [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-03 07:32: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: 1d14f71f-9d68-4708-a97a-c79abc719f00 Correlation ID: 67023915-8256-4743-adbd-1500cecf7ada Timestamp: 2026-07-03 07:32:31Z - Correlation ID: 67023915-8256-4743-adbd-1500cecf7ada - Trace ID: 1d14f71f-9d68-4708-a97a-c79abc719f00
Error getting the secret: invalid_client: 7000222 - [2026-07-03 07:32: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: 6fa1c8e4-a23a-477e-9fa2-49e83eff2600 Correlation ID: fbf8263f-1e40-4235-9b5c-ba871b155388 Timestamp: 2026-07-03 07:32:32Z - Correlation ID: fbf8263f-1e40-4235-9b5c-ba871b155388 - Trace ID: 6fa1c8e4-a23a-477e-9fa2-49e83eff2600
Error getting the secret: invalid_client: 7000222 - [2026-07-03 07:32: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: 10e6dc70-bd11-4efa-8850-335dbd212300 Correlation ID: a6072cb5-4ffa-4db3-a867-6b240424c738 Timestamp: 2026-07-03 07:32:32Z - Correlation ID: a6072cb5-4ffa-4db3-a867-6b240424c738 - Trace ID: 10e6dc70-bd11-4efa-8850-335dbd212300
Error getting the secret: invalid_client: 7000222 - [2026-07-03 07:32: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: e8727634-6e9c-4b34-9848-7fd3bb6d2400 Correlation ID: f4e70732-6bf9-4236-8334-77e70747638f Timestamp: 2026-07-03 07:32:32Z - Correlation ID: f4e70732-6bf9-4236-8334-77e70747638f - Trace ID: e8727634-6e9c-4b34-9848-7fd3bb6d2400
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)