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-02 00:38:14Z]: 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: 227fad6a-d243-44a8-a139-ce75b0cb8700 Correlation ID: 94c69447-bbeb-40ef-a563-af0631e6202a Timestamp: 2026-07-02 00:38:14Z - Correlation ID: 94c69447-bbeb-40ef-a563-af0631e6202a - Trace ID: 227fad6a-d243-44a8-a139-ce75b0cb8700
(node:4704) [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-02 00:38:14Z]: 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: 2699b04d-a436-41f1-ac7f-865bdf8a7a00 Correlation ID: e13030ff-6b1a-4e2b-af2d-fb1be9bf1b68 Timestamp: 2026-07-02 00:38:14Z - Correlation ID: e13030ff-6b1a-4e2b-af2d-fb1be9bf1b68 - Trace ID: 2699b04d-a436-41f1-ac7f-865bdf8a7a00
Error getting the secret: invalid_client: 7000222 - [2026-07-02 00:38:15Z]: 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: 585ea9bc-17b8-4612-9cd1-545349f60200 Correlation ID: d44414a8-cf33-4eda-826a-237d4b70ea8a Timestamp: 2026-07-02 00:38:15Z - Correlation ID: d44414a8-cf33-4eda-826a-237d4b70ea8a - Trace ID: 585ea9bc-17b8-4612-9cd1-545349f60200
Error getting the secret: invalid_client: 7000222 - [2026-07-02 00:38:15Z]: 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: 984aed6d-158b-427d-9ae2-cbe315776d00 Correlation ID: 8ab1307b-3ba6-4b2b-a6b3-08069a50a77d Timestamp: 2026-07-02 00:38:15Z - Correlation ID: 8ab1307b-3ba6-4b2b-a6b3-08069a50a77d - Trace ID: 984aed6d-158b-427d-9ae2-cbe315776d00
Error getting the secret: invalid_client: 7000222 - [2026-07-02 00:38:15Z]: 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: f8d55bd5-3019-4f76-b78a-52820b9f7300 Correlation ID: 9caacf34-f04f-4be2-828d-0e66505688ca Timestamp: 2026-07-02 00:38:15Z - Correlation ID: 9caacf34-f04f-4be2-828d-0e66505688ca - Trace ID: f8d55bd5-3019-4f76-b78a-52820b9f7300
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)