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-04 09:34:33Z]: 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: 058bc058-7c04-4bef-9ce3-1c42a0200800 Correlation ID: 70e2b0d8-cf0b-4cdc-bacd-eae415128655 Timestamp: 2026-07-04 09:34:33Z - Correlation ID: 70e2b0d8-cf0b-4cdc-bacd-eae415128655 - Trace ID: 058bc058-7c04-4bef-9ce3-1c42a0200800
(node:1436) [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-04 09:34:34Z]: 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: 736513f1-97f8-4640-9ff0-4d43143e0900 Correlation ID: 020effd7-b7b4-4d26-9dfc-0c28c93574a5 Timestamp: 2026-07-04 09:34:34Z - Correlation ID: 020effd7-b7b4-4d26-9dfc-0c28c93574a5 - Trace ID: 736513f1-97f8-4640-9ff0-4d43143e0900
Error getting the secret: invalid_client: 7000222 - [2026-07-04 09:34:34Z]: 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: 1f635f9b-dd4d-4b46-ad9b-7fa1f7bd0600 Correlation ID: 4eb45e3b-9966-4ebe-a2a7-1b80e2a4c239 Timestamp: 2026-07-04 09:34:34Z - Correlation ID: 4eb45e3b-9966-4ebe-a2a7-1b80e2a4c239 - Trace ID: 1f635f9b-dd4d-4b46-ad9b-7fa1f7bd0600
Error getting the secret: invalid_client: 7000222 - [2026-07-04 09:34:34Z]: 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: 49e3f64c-33fd-4d89-9061-5a5d8eaf0900 Correlation ID: 550d2b3b-989f-47d8-8ee4-2f736a998a3d Timestamp: 2026-07-04 09:34:34Z - Correlation ID: 550d2b3b-989f-47d8-8ee4-2f736a998a3d - Trace ID: 49e3f64c-33fd-4d89-9061-5a5d8eaf0900
Error getting the secret: invalid_client: 7000222 - [2026-07-04 09:34: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: 5b03de1f-6309-4e11-a529-bc92fb230700 Correlation ID: da68eea4-3fbd-46d4-84d3-3bc04a497161 Timestamp: 2026-07-04 09:34:35Z - Correlation ID: da68eea4-3fbd-46d4-84d3-3bc04a497161 - Trace ID: 5b03de1f-6309-4e11-a529-bc92fb230700
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)