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-10-03 03:15:20Z]: 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: de2721f3-2bcf-4824-9d22-4eb15152c200 Correlation ID: a49e53e9-c4c9-49ae-83f6-dcd4d6090080 Timestamp: 2026-10-03 03:15:20Z - Correlation ID: a49e53e9-c4c9-49ae-83f6-dcd4d6090080 - Trace ID: de2721f3-2bcf-4824-9d22-4eb15152c200
(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-10-03 03:15:20Z]: 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: 48089db4-7622-44c2-aed7-feba9f288200 Correlation ID: 0677a409-c816-4de7-bbb5-77fccf7e28d2 Timestamp: 2026-10-03 03:15:20Z - Correlation ID: 0677a409-c816-4de7-bbb5-77fccf7e28d2 - Trace ID: 48089db4-7622-44c2-aed7-feba9f288200
Error getting the secret: invalid_client: 7000222 - [2026-10-03 03:15:21Z]: 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: 878880cf-dc35-47c7-8da2-46f10ce2da00 Correlation ID: c8dbd906-db48-4239-b379-606476251cb2 Timestamp: 2026-10-03 03:15:21Z - Correlation ID: c8dbd906-db48-4239-b379-606476251cb2 - Trace ID: 878880cf-dc35-47c7-8da2-46f10ce2da00
Error getting the secret: invalid_client: 7000222 - [2026-10-03 03:15:21Z]: 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: de2721f3-2bcf-4824-9d22-4eb16e52c200 Correlation ID: a2a51aef-f52c-40b0-852a-30128909b0f5 Timestamp: 2026-10-03 03:15:21Z - Correlation ID: a2a51aef-f52c-40b0-852a-30128909b0f5 - Trace ID: de2721f3-2bcf-4824-9d22-4eb16e52c200
Error getting the secret: invalid_client: 7000222 - [2026-10-03 03:15:21Z]: 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: 878880cf-dc35-47c7-8da2-46f120e2da00 Correlation ID: 3bd50702-9b79-49f4-a85c-25bdf43c85b5 Timestamp: 2026-10-03 03:15:21Z - Correlation ID: 3bd50702-9b79-49f4-a85c-25bdf43c85b5 - Trace ID: 878880cf-dc35-47c7-8da2-46f120e2da00
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)