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-16 19:17:38Z]: 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: 255416c4-e2c6-41e1-a301-eb2836762e00 Correlation ID: 44e3f3b3-1520-4f1a-a5c1-bcbe238754d7 Timestamp: 2026-07-16 19:17:38Z - Correlation ID: 44e3f3b3-1520-4f1a-a5c1-bcbe238754d7 - Trace ID: 255416c4-e2c6-41e1-a301-eb2836762e00
(node:4160) [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-16 19:17:38Z]: 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: 9ff5f450-c5b4-42bc-85ee-a3a8120a3200 Correlation ID: b8ac4975-332c-43d6-a9c2-73a478e9826a Timestamp: 2026-07-16 19:17:38Z - Correlation ID: b8ac4975-332c-43d6-a9c2-73a478e9826a - Trace ID: 9ff5f450-c5b4-42bc-85ee-a3a8120a3200
Error getting the secret: invalid_client: 7000222 - [2026-07-16 19:17:39Z]: 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: 93dc6bc0-e0a1-44c7-adf3-b92884db1500 Correlation ID: 09a13b68-b399-47af-b7c0-fcaa4d1d8f60 Timestamp: 2026-07-16 19:17:39Z - Correlation ID: 09a13b68-b399-47af-b7c0-fcaa4d1d8f60 - Trace ID: 93dc6bc0-e0a1-44c7-adf3-b92884db1500
Error getting the secret: invalid_client: 7000222 - [2026-07-16 19:17:39Z]: 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: bcecaf8b-be45-4b93-b286-b37ebc9d1500 Correlation ID: 4ba0b732-3ea2-4169-9a08-3cc2379fa39f Timestamp: 2026-07-16 19:17:39Z - Correlation ID: 4ba0b732-3ea2-4169-9a08-3cc2379fa39f - Trace ID: bcecaf8b-be45-4b93-b286-b37ebc9d1500
Error getting the secret: invalid_client: 7000222 - [2026-07-16 19:17:39Z]: 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: eddb2444-b86a-47c6-9930-15f1814b3200 Correlation ID: dac8ab95-e3ae-425c-ba11-6c6b20835869 Timestamp: 2026-07-16 19:17:39Z - Correlation ID: dac8ab95-e3ae-425c-ba11-6c6b20835869 - Trace ID: eddb2444-b86a-47c6-9930-15f1814b3200
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)