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-18 11:23:56Z]: 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: 821146d0-133b-4bc7-ac0c-896f97180300 Correlation ID: f6f788f7-f7d0-4d83-9023-8a1c4e4e7efe Timestamp: 2026-07-18 11:23:56Z - Correlation ID: f6f788f7-f7d0-4d83-9023-8a1c4e4e7efe - Trace ID: 821146d0-133b-4bc7-ac0c-896f97180300
(node:1440) [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-18 11:23:56Z]: 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: f58e4d24-7fcb-47a9-a268-35b433800400 Correlation ID: 78f59fa9-c150-4a76-8dfb-10a314e82887 Timestamp: 2026-07-18 11:23:56Z - Correlation ID: 78f59fa9-c150-4a76-8dfb-10a314e82887 - Trace ID: f58e4d24-7fcb-47a9-a268-35b433800400
Error getting the secret: invalid_client: 7000222 - [2026-07-18 11:23:56Z]: 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: 821146d0-133b-4bc7-ac0c-896f9f180300 Correlation ID: b8b4ee58-bbd7-4751-934b-07b276892883 Timestamp: 2026-07-18 11:23:56Z - Correlation ID: b8b4ee58-bbd7-4751-934b-07b276892883 - Trace ID: 821146d0-133b-4bc7-ac0c-896f9f180300
Error getting the secret: invalid_client: 7000222 - [2026-07-18 11:23:57Z]: 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: 821146d0-133b-4bc7-ac0c-896fa1180300 Correlation ID: f3175710-e877-4ba0-a38f-431502338797 Timestamp: 2026-07-18 11:23:57Z - Correlation ID: f3175710-e877-4ba0-a38f-431502338797 - Trace ID: 821146d0-133b-4bc7-ac0c-896fa1180300
Error getting the secret: invalid_client: 7000222 - [2026-07-18 11:23:57Z]: 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: 80739493-045b-47cc-8cc0-b1433d2e0300 Correlation ID: 54242468-cbb4-47bb-adbc-912c4fa7f797 Timestamp: 2026-07-18 11:23:57Z - Correlation ID: 54242468-cbb4-47bb-adbc-912c4fa7f797 - Trace ID: 80739493-045b-47cc-8cc0-b1433d2e0300
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)