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-11-26 11:37:04Z]: 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: 379b0da8-6abf-40a3-a6a2-4ea7f3b96900 Correlation ID: 41b7eeaf-f44a-40de-a363-76d31f1af367 Timestamp: 2026-11-26 11:37:04Z - Correlation ID: 41b7eeaf-f44a-40de-a363-76d31f1af367 - Trace ID: 379b0da8-6abf-40a3-a6a2-4ea7f3b96900
(node:5748) [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-11-26 11:37:04Z]: 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: 6e1b8b2c-6f35-4ca2-9c67-444dfad27200 Correlation ID: 457df532-1268-4840-95fb-e8521c2cc344 Timestamp: 2026-11-26 11:37:04Z - Correlation ID: 457df532-1268-4840-95fb-e8521c2cc344 - Trace ID: 6e1b8b2c-6f35-4ca2-9c67-444dfad27200
Error getting the secret: invalid_client: 7000222 - [2026-11-26 11:37:05Z]: 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: 907b4f51-c4f4-4e53-8f7a-59c778ea7100 Correlation ID: a18177bb-e4ca-43d4-a8e9-2f8669da0f85 Timestamp: 2026-11-26 11:37:05Z - Correlation ID: a18177bb-e4ca-43d4-a8e9-2f8669da0f85 - Trace ID: 907b4f51-c4f4-4e53-8f7a-59c778ea7100
Error getting the secret: invalid_client: 7000222 - [2026-11-26 11:37:05Z]: 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: fb4f2510-516f-4aea-8460-f50fc8906c00 Correlation ID: 774005ea-c746-4ff3-911d-dfadcf91bb40 Timestamp: 2026-11-26 11:37:05Z - Correlation ID: 774005ea-c746-4ff3-911d-dfadcf91bb40 - Trace ID: fb4f2510-516f-4aea-8460-f50fc8906c00
Error getting the secret: invalid_client: 7000222 - [2026-11-26 11:37:05Z]: 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: 6e1b8b2c-6f35-4ca2-9c67-444d22d37200 Correlation ID: 83800f1b-2e45-43f5-ba0a-0a584b0d59cd Timestamp: 2026-11-26 11:37:05Z - Correlation ID: 83800f1b-2e45-43f5-ba0a-0a584b0d59cd - Trace ID: 6e1b8b2c-6f35-4ca2-9c67-444d22d37200
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)