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-06 21:31:26Z]: 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: a2caa6d8-e24f-4f49-9b03-6ba00e474700 Correlation ID: 61e7b1d3-c572-4030-959e-5c3cc7072df2 Timestamp: 2026-07-06 21:31:26Z - Correlation ID: 61e7b1d3-c572-4030-959e-5c3cc7072df2 - Trace ID: a2caa6d8-e24f-4f49-9b03-6ba00e474700
(node:3596) [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-06 21:31:26Z]: 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: c8a8d21b-f695-43fe-ab4c-939f0a1d3300 Correlation ID: 4c1222f5-7128-40a4-a730-3a3a9e4d78e1 Timestamp: 2026-07-06 21:31:26Z - Correlation ID: 4c1222f5-7128-40a4-a730-3a3a9e4d78e1 - Trace ID: c8a8d21b-f695-43fe-ab4c-939f0a1d3300
Error getting the secret: invalid_client: 7000222 - [2026-07-06 21:31:27Z]: 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: 85600ee1-10a0-4275-bc4e-5738a86d4c00 Correlation ID: 3da1c8a1-fae6-4e36-9b98-45bc5336ba8d Timestamp: 2026-07-06 21:31:27Z - Correlation ID: 3da1c8a1-fae6-4e36-9b98-45bc5336ba8d - Trace ID: 85600ee1-10a0-4275-bc4e-5738a86d4c00
Error getting the secret: invalid_client: 7000222 - [2026-07-06 21:31:27Z]: 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: 85600ee1-10a0-4275-bc4e-5738af6d4c00 Correlation ID: 0d810159-60af-4b4c-8fc2-a310fa558eaa Timestamp: 2026-07-06 21:31:27Z - Correlation ID: 0d810159-60af-4b4c-8fc2-a310fa558eaa - Trace ID: 85600ee1-10a0-4275-bc4e-5738af6d4c00
Error getting the secret: invalid_client: 7000222 - [2026-07-06 21:31:27Z]: 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: 0103a658-1062-4ef6-88fe-c220a44b3c00 Correlation ID: 05bf565b-58d2-42cc-971e-0ecd5fd0c8a7 Timestamp: 2026-07-06 21:31:27Z - Correlation ID: 05bf565b-58d2-42cc-971e-0ecd5fd0c8a7 - Trace ID: 0103a658-1062-4ef6-88fe-c220a44b3c00
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)