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 11:31:24Z]: 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: c696105b-8b25-4113-8065-4ebb79db2d00 Correlation ID: e6ff2382-7e7c-4bc2-bfbb-72a5954f939a Timestamp: 2026-07-06 11:31:24Z - Correlation ID: e6ff2382-7e7c-4bc2-bfbb-72a5954f939a - Trace ID: c696105b-8b25-4113-8065-4ebb79db2d00
(node:3248) [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 11:31:25Z]: 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: b852fcc2-907c-4192-a67c-ad7151404100 Correlation ID: b4b8dd7d-a1c0-425d-ad68-0daf0a862b54 Timestamp: 2026-07-06 11:31:25Z - Correlation ID: b4b8dd7d-a1c0-425d-ad68-0daf0a862b54 - Trace ID: b852fcc2-907c-4192-a67c-ad7151404100
Error getting the secret: invalid_client: 7000222 - [2026-07-06 11:31:25Z]: 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: 7b8786a9-a2c7-483b-8393-8cc5040b2f00 Correlation ID: 0b99f47f-4913-44b7-b529-9331a70ecc75 Timestamp: 2026-07-06 11:31:25Z - Correlation ID: 0b99f47f-4913-44b7-b529-9331a70ecc75 - Trace ID: 7b8786a9-a2c7-483b-8393-8cc5040b2f00
Error getting the secret: invalid_client: 7000222 - [2026-07-06 11: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: 6eb47877-2ba2-4435-abf8-eba93db02300 Correlation ID: 0c577a52-c761-47ee-8189-a91284dd1674 Timestamp: 2026-07-06 11:31:26Z - Correlation ID: 0c577a52-c761-47ee-8189-a91284dd1674 - Trace ID: 6eb47877-2ba2-4435-abf8-eba93db02300
Error getting the secret: invalid_client: 7000222 - [2026-07-06 11: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: bb048a5b-e1ec-4c37-901e-a303aa783000 Correlation ID: 9008da02-aae7-409b-99c9-746ddd956033 Timestamp: 2026-07-06 11:31:26Z - Correlation ID: 9008da02-aae7-409b-99c9-746ddd956033 - Trace ID: bb048a5b-e1ec-4c37-901e-a303aa783000
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)