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-05 18:12:49Z]: 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: bfaa161a-3e69-414a-a3f9-6bb6f696cf00 Correlation ID: e044f06f-c2c7-445f-ab70-23fe976b515d Timestamp: 2026-10-05 18:12:49Z - Correlation ID: e044f06f-c2c7-445f-ab70-23fe976b515d - Trace ID: bfaa161a-3e69-414a-a3f9-6bb6f696cf00
(node:2520) [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-05 18:12:49Z]: 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: 63ec8f1b-d6cf-4d76-a2d8-78c666d4d600 Correlation ID: 503262ab-e55b-44f0-a52b-d4d1f078d6a4 Timestamp: 2026-10-05 18:12:49Z - Correlation ID: 503262ab-e55b-44f0-a52b-d4d1f078d6a4 - Trace ID: 63ec8f1b-d6cf-4d76-a2d8-78c666d4d600
Error getting the secret: invalid_client: 7000222 - [2026-10-05 18:12:49Z]: 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: 4242a6e5-d344-4c5e-8cf6-637399cdd000 Correlation ID: b0e84d38-3f6e-4278-80a5-f86de4103172 Timestamp: 2026-10-05 18:12:49Z - Correlation ID: b0e84d38-3f6e-4278-80a5-f86de4103172 - Trace ID: 4242a6e5-d344-4c5e-8cf6-637399cdd000
Error getting the secret: invalid_client: 7000222 - [2026-10-05 18:12:50Z]: 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: 533a2197-c1c1-400c-9d27-61fb3fab9400 Correlation ID: 1a9abbf5-3f96-4257-b77b-8bf45c7662aa Timestamp: 2026-10-05 18:12:50Z - Correlation ID: 1a9abbf5-3f96-4257-b77b-8bf45c7662aa - Trace ID: 533a2197-c1c1-400c-9d27-61fb3fab9400
Error getting the secret: invalid_client: 7000222 - [2026-10-05 18:12:50Z]: 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: 20d4fdcc-74c5-4b07-b905-c9b0088faf00 Correlation ID: 725a2249-85d2-4468-9650-8b603611175e Timestamp: 2026-10-05 18:12:50Z - Correlation ID: 725a2249-85d2-4468-9650-8b603611175e - Trace ID: 20d4fdcc-74c5-4b07-b905-c9b0088faf00
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)