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-11 20:39:29Z]: 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: 5453df6e-3d66-4e69-ac54-e0c8f5a30200 Correlation ID: c751e3c2-6b09-4574-841a-75b151c513d0 Timestamp: 2026-07-11 20:39:29Z - Correlation ID: c751e3c2-6b09-4574-841a-75b151c513d0 - Trace ID: 5453df6e-3d66-4e69-ac54-e0c8f5a30200
(node:5356) [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-11 20:39:29Z]: 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: 87817d0a-01df-4042-987e-9df5c69c1200 Correlation ID: 55d439cd-68e1-4db8-b7c0-e3d4530e598d Timestamp: 2026-07-11 20:39:29Z - Correlation ID: 55d439cd-68e1-4db8-b7c0-e3d4530e598d - Trace ID: 87817d0a-01df-4042-987e-9df5c69c1200
Error getting the secret: invalid_client: 7000222 - [2026-07-11 20:39:30Z]: 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: 28625c92-ae73-4898-a262-745f3f793700 Correlation ID: 426e4414-467e-4975-8c4a-20c3e0f2cf80 Timestamp: 2026-07-11 20:39:30Z - Correlation ID: 426e4414-467e-4975-8c4a-20c3e0f2cf80 - Trace ID: 28625c92-ae73-4898-a262-745f3f793700
Error getting the secret: invalid_client: 7000222 - [2026-07-11 20:39:30Z]: 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: f5298dd3-6455-4b1b-8087-636a44210900 Correlation ID: 80d4d6d4-0b4a-453c-81ec-ed82c4894d08 Timestamp: 2026-07-11 20:39:30Z - Correlation ID: 80d4d6d4-0b4a-453c-81ec-ed82c4894d08 - Trace ID: f5298dd3-6455-4b1b-8087-636a44210900
Error getting the secret: invalid_client: 7000222 - [2026-07-11 20:39:30Z]: 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: 87817d0a-01df-4042-987e-9df5cb9c1200 Correlation ID: c058386a-f9a9-417b-909e-26b6e7088f0f Timestamp: 2026-07-11 20:39:30Z - Correlation ID: c058386a-f9a9-417b-909e-26b6e7088f0f - Trace ID: 87817d0a-01df-4042-987e-9df5cb9c1200
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)