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-20 21:51:04Z]: 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: bc0f7357-892b-4891-985b-f8f6b98c1a00 Correlation ID: 6174a736-bcbb-4b5d-9110-d5ee4a9e9591 Timestamp: 2026-07-20 21:51:04Z - Correlation ID: 6174a736-bcbb-4b5d-9110-d5ee4a9e9591 - Trace ID: bc0f7357-892b-4891-985b-f8f6b98c1a00
(node:384) [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-20 21:51:04Z]: 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: d2d35fc1-f6d2-4817-85d7-0602bedc0000 Correlation ID: e15fb830-c479-4146-a8b6-35f7bc4b8571 Timestamp: 2026-07-20 21:51:04Z - Correlation ID: e15fb830-c479-4146-a8b6-35f7bc4b8571 - Trace ID: d2d35fc1-f6d2-4817-85d7-0602bedc0000
Error getting the secret: invalid_client: 7000222 - [2026-07-20 21:51:04Z]: 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: 343b0227-4a8e-4663-8ff5-699b351f0000 Correlation ID: 26c752a1-cc46-4331-b49f-18588cb48a9e Timestamp: 2026-07-20 21:51:04Z - Correlation ID: 26c752a1-cc46-4331-b49f-18588cb48a9e - Trace ID: 343b0227-4a8e-4663-8ff5-699b351f0000
Error getting the secret: invalid_client: 7000222 - [2026-07-20 21:51:04Z]: 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: bb3ebbe6-8fdc-445b-9bdd-2839915b0200 Correlation ID: ad99749f-2bf0-42b5-84e8-8b86dbe460a8 Timestamp: 2026-07-20 21:51:04Z - Correlation ID: ad99749f-2bf0-42b5-84e8-8b86dbe460a8 - Trace ID: bb3ebbe6-8fdc-445b-9bdd-2839915b0200
Error getting the secret: invalid_client: 7000222 - [2026-07-20 21:51:04Z]: 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: 343b0227-4a8e-4663-8ff5-699b3b1f0000 Correlation ID: e9c40764-50ae-4e4a-9a2e-e4cec3c89a7f Timestamp: 2026-07-20 21:51:04Z - Correlation ID: e9c40764-50ae-4e4a-9a2e-e4cec3c89a7f - Trace ID: 343b0227-4a8e-4663-8ff5-699b3b1f0000
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)