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-06-12 21:48:35Z]: 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: 403876df-d994-471a-b5c2-9950b8b98100 Correlation ID: e77da054-6571-49c5-8bfe-df94e2706cc5 Timestamp: 2026-06-12 21:48:35Z - Correlation ID: e77da054-6571-49c5-8bfe-df94e2706cc5 - Trace ID: 403876df-d994-471a-b5c2-9950b8b98100
(node:1860) [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-06-12 21:48:35Z]: 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: aeeebe40-b8f7-4e6c-bcba-343006198b00 Correlation ID: ecdd0e96-bbac-4281-adc1-73070109749a Timestamp: 2026-06-12 21:48:35Z - Correlation ID: ecdd0e96-bbac-4281-adc1-73070109749a - Trace ID: aeeebe40-b8f7-4e6c-bcba-343006198b00
Error getting the secret: invalid_client: 7000222 - [2026-06-12 21:48:35Z]: 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: aeeebe40-b8f7-4e6c-bcba-343010198b00 Correlation ID: ed886e04-1261-496d-bbbe-462117f1fbe3 Timestamp: 2026-06-12 21:48:35Z - Correlation ID: ed886e04-1261-496d-bbbe-462117f1fbe3 - Trace ID: aeeebe40-b8f7-4e6c-bcba-343010198b00
Error getting the secret: invalid_client: 7000222 - [2026-06-12 21:48:36Z]: 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: 374d3d30-27dc-4b78-86f3-bd208a321d00 Correlation ID: dee82963-16e1-4601-9a2d-7bae3fd1c4fe Timestamp: 2026-06-12 21:48:36Z - Correlation ID: dee82963-16e1-4601-9a2d-7bae3fd1c4fe - Trace ID: 374d3d30-27dc-4b78-86f3-bd208a321d00
Error getting the secret: invalid_client: 7000222 - [2026-06-12 21:48:36Z]: 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: 9a74110c-228e-47cd-8c55-66f19b064500 Correlation ID: 1616ac0b-4802-4161-ade0-c37a1d31075f Timestamp: 2026-06-12 21:48:36Z - Correlation ID: 1616ac0b-4802-4161-ade0-c37a1d31075f - Trace ID: 9a74110c-228e-47cd-8c55-66f19b064500
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)