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-12 20:24:47Z]: 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: d96bd140-b20f-4e25-ad42-e5ab139e0f00 Correlation ID: 8d0aecbf-60bb-4132-acfa-685ee49a608d Timestamp: 2026-07-12 20:24:47Z - Correlation ID: 8d0aecbf-60bb-4132-acfa-685ee49a608d - Trace ID: d96bd140-b20f-4e25-ad42-e5ab139e0f00
(node:4028) [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-12 20:24:47Z]: 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: 4022b12b-f8af-4378-898e-8a99b3600c00 Correlation ID: 3b942df1-8b1c-4bab-a0ad-d86cd1a3f68e Timestamp: 2026-07-12 20:24:47Z - Correlation ID: 3b942df1-8b1c-4bab-a0ad-d86cd1a3f68e - Trace ID: 4022b12b-f8af-4378-898e-8a99b3600c00
Error getting the secret: invalid_client: 7000222 - [2026-07-12 20:24:47Z]: 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: 14ff76e0-fcf8-4608-8ddd-83da60bd0b00 Correlation ID: 13c2ddee-b11e-4430-be5f-8c881c764196 Timestamp: 2026-07-12 20:24:47Z - Correlation ID: 13c2ddee-b11e-4430-be5f-8c881c764196 - Trace ID: 14ff76e0-fcf8-4608-8ddd-83da60bd0b00
Error getting the secret: invalid_client: 7000222 - [2026-07-12 20:24:47Z]: 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: bf22740b-864e-46cc-92c2-74c1412d0b00 Correlation ID: 93c0792c-9742-4dde-934d-b3b8797cb620 Timestamp: 2026-07-12 20:24:47Z - Correlation ID: 93c0792c-9742-4dde-934d-b3b8797cb620 - Trace ID: bf22740b-864e-46cc-92c2-74c1412d0b00
Error getting the secret: invalid_client: 7000222 - [2026-07-12 20:24:47Z]: 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: 4022b12b-f8af-4378-898e-8a99b8600c00 Correlation ID: c62eae51-a4e2-48d0-918d-7dd7c4885b63 Timestamp: 2026-07-12 20:24:47Z - Correlation ID: c62eae51-a4e2-48d0-918d-7dd7c4885b63 - Trace ID: 4022b12b-f8af-4378-898e-8a99b8600c00
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)