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-18 21:54:22Z]: 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: 15192388-f541-46d0-ba05-a6d501514d00 Correlation ID: 1cafe9a9-f42c-4abf-9363-5ac31722d866 Timestamp: 2026-07-18 21:54:22Z - Correlation ID: 1cafe9a9-f42c-4abf-9363-5ac31722d866 - Trace ID: 15192388-f541-46d0-ba05-a6d501514d00
(node:4968) [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-18 21:54:22Z]: 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: a7d6a9d2-1cc7-40c0-b903-050cc95d4000 Correlation ID: b7e61dbb-8408-41e1-aaf0-db05d7b77f45 Timestamp: 2026-07-18 21:54:22Z - Correlation ID: b7e61dbb-8408-41e1-aaf0-db05d7b77f45 - Trace ID: a7d6a9d2-1cc7-40c0-b903-050cc95d4000
Error getting the secret: invalid_client: 7000222 - [2026-07-18 21:54:22Z]: 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: 07500864-e7f5-4879-a8ba-f53d8de70b00 Correlation ID: bbe740a6-2619-45d3-965c-ee7f8d1e0ed1 Timestamp: 2026-07-18 21:54:22Z - Correlation ID: bbe740a6-2619-45d3-965c-ee7f8d1e0ed1 - Trace ID: 07500864-e7f5-4879-a8ba-f53d8de70b00
Error getting the secret: invalid_client: 7000222 - [2026-07-18 21:54:23Z]: 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: a7d6a9d2-1cc7-40c0-b903-050cd55d4000 Correlation ID: d847b829-80dc-475b-9f99-043ef78add49 Timestamp: 2026-07-18 21:54:23Z - Correlation ID: d847b829-80dc-475b-9f99-043ef78add49 - Trace ID: a7d6a9d2-1cc7-40c0-b903-050cd55d4000
Error getting the secret: invalid_client: 7000222 - [2026-07-18 21:54:23Z]: 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: c606ef0e-04e1-4406-be39-f07b78420b00 Correlation ID: 054bf587-82b4-45a6-a857-ec9af5167bd5 Timestamp: 2026-07-18 21:54:23Z - Correlation ID: 054bf587-82b4-45a6-a857-ec9af5167bd5 - Trace ID: c606ef0e-04e1-4406-be39-f07b78420b00
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)