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-06-18 00:08:01Z]: 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: 8ecee2bf-7038-411f-a6e4-05881ace0200 Correlation ID: da775f39-f097-4d33-b425-090e4870f977 Timestamp: 2026-06-18 00:08:01Z - Correlation ID: da775f39-f097-4d33-b425-090e4870f977 - Trace ID: 8ecee2bf-7038-411f-a6e4-05881ace0200
(node:3668) [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-06-18 00:08:01Z]: 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: a54c10a2-9534-42bf-9727-e1cfad1a6900 Correlation ID: b1ed2ec3-5aec-4d44-997b-3c17bd109ddc Timestamp: 2026-06-18 00:08:01Z - Correlation ID: b1ed2ec3-5aec-4d44-997b-3c17bd109ddc - Trace ID: a54c10a2-9534-42bf-9727-e1cfad1a6900
Error getting the secret: invalid_client: 7000222 - [2026-06-18 00:08:01Z]: 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: a930eb85-676e-4274-8e30-5a5a2ef83000 Correlation ID: 6ac78d95-802b-42ee-b961-c25c3d9de0d4 Timestamp: 2026-06-18 00:08:01Z - Correlation ID: 6ac78d95-802b-42ee-b961-c25c3d9de0d4 - Trace ID: a930eb85-676e-4274-8e30-5a5a2ef83000
Error getting the secret: invalid_client: 7000222 - [2026-06-18 00:08:02Z]: 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: a930eb85-676e-4274-8e30-5a5a37f83000 Correlation ID: de3eff84-19c9-4791-af22-d14e0a6c4b06 Timestamp: 2026-06-18 00:08:02Z - Correlation ID: de3eff84-19c9-4791-af22-d14e0a6c4b06 - Trace ID: a930eb85-676e-4274-8e30-5a5a37f83000
Error getting the secret: invalid_client: 7000222 - [2026-06-18 00:08:02Z]: 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: 2cdbc1cf-e9aa-4198-bccb-315989bb1e00 Correlation ID: 6bd0f666-40fc-47a3-bb79-844600d5894b Timestamp: 2026-06-18 00:08:02Z - Correlation ID: 6bd0f666-40fc-47a3-bb79-844600d5894b - Trace ID: 2cdbc1cf-e9aa-4198-bccb-315989bb1e00
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)