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-17 12:04: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: 86323a26-a218-43c1-825a-a73ab1d24d00 Correlation ID: d753afd9-e9c5-43c6-b26a-c3cb5dc637bc Timestamp: 2026-07-17 12:04:49Z - Correlation ID: d753afd9-e9c5-43c6-b26a-c3cb5dc637bc - Trace ID: 86323a26-a218-43c1-825a-a73ab1d24d00
(node:2956) [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-17 12:04: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: f4b0be13-0410-4e2e-99cf-bc61ecaf4400 Correlation ID: f7d1968d-366f-4704-a496-68e3dc8712ac Timestamp: 2026-07-17 12:04:49Z - Correlation ID: f7d1968d-366f-4704-a496-68e3dc8712ac - Trace ID: f4b0be13-0410-4e2e-99cf-bc61ecaf4400
Error getting the secret: invalid_client: 7000222 - [2026-07-17 12:04: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: f4b0be13-0410-4e2e-99cf-bc61f8af4400 Correlation ID: 9d8ea2aa-d119-456c-b8af-29c861e51365 Timestamp: 2026-07-17 12:04:50Z - Correlation ID: 9d8ea2aa-d119-456c-b8af-29c861e51365 - Trace ID: f4b0be13-0410-4e2e-99cf-bc61f8af4400
Error getting the secret: invalid_client: 7000222 - [2026-07-17 12:04: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: d2e50e76-e8d2-4d00-a8cf-154601a54500 Correlation ID: 1d4aae46-a508-4fd5-a59b-66912c8a0842 Timestamp: 2026-07-17 12:04:50Z - Correlation ID: 1d4aae46-a508-4fd5-a59b-66912c8a0842 - Trace ID: d2e50e76-e8d2-4d00-a8cf-154601a54500
Error getting the secret: invalid_client: 7000222 - [2026-07-17 12:04: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: 9e09501e-a9f6-4324-a787-683128e82400 Correlation ID: 4bfbe587-0e57-48de-8b7b-14a6bc1844ee Timestamp: 2026-07-17 12:04:50Z - Correlation ID: 4bfbe587-0e57-48de-8b7b-14a6bc1844ee - Trace ID: 9e09501e-a9f6-4324-a787-683128e82400
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)