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-04-21 03:19: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: 817efaaa-8c04-4b69-b2d7-61e7486b1400 Correlation ID: c1d53fb9-4650-4382-bd73-c8c6c8999132 Timestamp: 2026-04-21 03:19:30Z - Correlation ID: c1d53fb9-4650-4382-bd73-c8c6c8999132 - Trace ID: 817efaaa-8c04-4b69-b2d7-61e7486b1400
(node:4056) [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-04-21 03:19: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: f4d6ec2c-d6cb-4f6c-a380-2e7a52e82300 Correlation ID: 558f7d65-24d3-4e42-8a2e-06a8c0291eb4 Timestamp: 2026-04-21 03:19:30Z - Correlation ID: 558f7d65-24d3-4e42-8a2e-06a8c0291eb4 - Trace ID: f4d6ec2c-d6cb-4f6c-a380-2e7a52e82300
Error getting the secret: invalid_client: 7000222 - [2026-04-21 03:19: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: a2f4862e-20d6-4bdd-9a75-4eac48480700 Correlation ID: 4b04122c-3aee-411f-adea-981d0b7cee12 Timestamp: 2026-04-21 03:19:30Z - Correlation ID: 4b04122c-3aee-411f-adea-981d0b7cee12 - Trace ID: a2f4862e-20d6-4bdd-9a75-4eac48480700
Error getting the secret: invalid_client: 7000222 - [2026-04-21 03:19:31Z]: 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: 2401428d-6e77-4747-afc8-89265dc32000 Correlation ID: 42b11196-dc93-42e6-9b0a-ec7e62782ed9 Timestamp: 2026-04-21 03:19:31Z - Correlation ID: 42b11196-dc93-42e6-9b0a-ec7e62782ed9 - Trace ID: 2401428d-6e77-4747-afc8-89265dc32000
Error getting the secret: invalid_client: 7000222 - [2026-04-21 03:19:31Z]: 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: 4fc696aa-e97f-417f-adb9-de3f7d371700 Correlation ID: 2c5f2daf-9509-4920-b261-ce82aef4a288 Timestamp: 2026-04-21 03:19:31Z - Correlation ID: 2c5f2daf-9509-4920-b261-ce82aef4a288 - Trace ID: 4fc696aa-e97f-417f-adb9-de3f7d371700
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)