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-10-06 08:06:52Z]: 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: 77766faa-9eb6-4ce9-b6f8-6ddc3d1ee800 Correlation ID: 3f9b0e82-86ab-4512-ab6e-2a76fab50f87 Timestamp: 2026-10-06 08:06:52Z - Correlation ID: 3f9b0e82-86ab-4512-ab6e-2a76fab50f87 - Trace ID: 77766faa-9eb6-4ce9-b6f8-6ddc3d1ee800
(node:5180) [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-10-06 08:06:52Z]: 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: 748003d8-9080-4fd8-b7fa-2656f0891500 Correlation ID: bd7bbf5b-f998-42c4-b103-cc3ea2888119 Timestamp: 2026-10-06 08:06:52Z - Correlation ID: bd7bbf5b-f998-42c4-b103-cc3ea2888119 - Trace ID: 748003d8-9080-4fd8-b7fa-2656f0891500
Error getting the secret: invalid_client: 7000222 - [2026-10-06 08:06:53Z]: 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: 661edb60-a9de-4690-ac38-e11b9bd81500 Correlation ID: 8e3d016c-910c-45e1-b3f8-d0522ce68c5b Timestamp: 2026-10-06 08:06:53Z - Correlation ID: 8e3d016c-910c-45e1-b3f8-d0522ce68c5b - Trace ID: 661edb60-a9de-4690-ac38-e11b9bd81500
Error getting the secret: invalid_client: 7000222 - [2026-10-06 08:06:53Z]: 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: 45b5a461-0651-4fb8-aa33-7931487ce400 Correlation ID: 342d161e-fbcf-487a-a16a-a0ffa5b03a8d Timestamp: 2026-10-06 08:06:53Z - Correlation ID: 342d161e-fbcf-487a-a16a-a0ffa5b03a8d - Trace ID: 45b5a461-0651-4fb8-aa33-7931487ce400
Error getting the secret: invalid_client: 7000222 - [2026-10-06 08:06:53Z]: 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: 6091cac4-e58c-407b-8f9b-18da26270801 Correlation ID: f3002b40-80c6-4f84-8013-1fa6bf9a5831 Timestamp: 2026-10-06 08:06:53Z - Correlation ID: f3002b40-80c6-4f84-8013-1fa6bf9a5831 - Trace ID: 6091cac4-e58c-407b-8f9b-18da26270801
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)