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-12 00:54: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: f2b229d6-3a01-4e27-9fab-ee6376ff3400 Correlation ID: bb759cfc-30ab-429f-bca3-c832f8678f99 Timestamp: 2026-07-12 00:54:31Z - Correlation ID: bb759cfc-30ab-429f-bca3-c832f8678f99 - Trace ID: f2b229d6-3a01-4e27-9fab-ee6376ff3400
(node:5948) [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-12 00:54: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: d89f346c-0459-409a-ba17-052b82240500 Correlation ID: c96e4ee3-8076-4d1d-860d-8a3289890992 Timestamp: 2026-07-12 00:54:31Z - Correlation ID: c96e4ee3-8076-4d1d-860d-8a3289890992 - Trace ID: d89f346c-0459-409a-ba17-052b82240500
Error getting the secret: invalid_client: 7000222 - [2026-07-12 00:54: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: 4da04f50-4341-4dee-be17-bc22f022d700 Correlation ID: 2f9f5b33-a08d-4efc-8f2e-338b198253c1 Timestamp: 2026-07-12 00:54:31Z - Correlation ID: 2f9f5b33-a08d-4efc-8f2e-338b198253c1 - Trace ID: 4da04f50-4341-4dee-be17-bc22f022d700
Error getting the secret: invalid_client: 7000222 - [2026-07-12 00:54: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: 5f7e703e-dd30-41f9-ac71-794053524900 Correlation ID: 96a89da6-5bff-4ff7-b4b6-7fe532972c45 Timestamp: 2026-07-12 00:54:31Z - Correlation ID: 96a89da6-5bff-4ff7-b4b6-7fe532972c45 - Trace ID: 5f7e703e-dd30-41f9-ac71-794053524900
Error getting the secret: invalid_client: 7000222 - [2026-07-12 00:54: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: 28ce3f2a-b487-4c04-91e2-363cc1dc0400 Correlation ID: bcae9803-5203-4d79-b70e-4e9d6d9a75b1 Timestamp: 2026-07-12 00:54:31Z - Correlation ID: bcae9803-5203-4d79-b70e-4e9d6d9a75b1 - Trace ID: 28ce3f2a-b487-4c04-91e2-363cc1dc0400
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)