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 01:39: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: 05f3f3c2-765c-494c-9e03-0bd1db9f0000 Correlation ID: c99f34f1-f6cf-4d1c-b488-f3ecd2b62b6f Timestamp: 2026-07-20 01:39:17Z - Correlation ID: c99f34f1-f6cf-4d1c-b488-f3ecd2b62b6f - Trace ID: 05f3f3c2-765c-494c-9e03-0bd1db9f0000
(node:2808) [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 01:39: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: 98bf4b6a-149e-4c98-a314-5f39bd162200 Correlation ID: 9ff7cd90-106d-4179-91de-0e9cd771f112 Timestamp: 2026-07-20 01:39:18Z - Correlation ID: 9ff7cd90-106d-4179-91de-0e9cd771f112 - Trace ID: 98bf4b6a-149e-4c98-a314-5f39bd162200
Error getting the secret: invalid_client: 7000222 - [2026-07-20 01:39: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: a3fd1967-39cb-4a5f-bad6-c92d4f060100 Correlation ID: 374256d6-7202-4046-9825-81f27106e50c Timestamp: 2026-07-20 01:39:18Z - Correlation ID: 374256d6-7202-4046-9825-81f27106e50c - Trace ID: a3fd1967-39cb-4a5f-bad6-c92d4f060100
Error getting the secret: invalid_client: 7000222 - [2026-07-20 01:39: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: 7e815615-8890-4075-8841-c74d9b521c00 Correlation ID: 4b2f2a2f-00f8-4782-8635-76b7ffea22fa Timestamp: 2026-07-20 01:39:18Z - Correlation ID: 4b2f2a2f-00f8-4782-8635-76b7ffea22fa - Trace ID: 7e815615-8890-4075-8841-c74d9b521c00
Error getting the secret: invalid_client: 7000222 - [2026-07-20 01:39: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: 98bf4b6a-149e-4c98-a314-5f39cf162200 Correlation ID: d071efe9-6241-4b77-8649-feaf25124820 Timestamp: 2026-07-20 01:39:18Z - Correlation ID: d071efe9-6241-4b77-8649-feaf25124820 - Trace ID: 98bf4b6a-149e-4c98-a314-5f39cf162200
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)