Your login screen works locally. You point it at the staging user pool and every sign-in comes back as an error before it ever reaches a password check.
The code your AI assistant wrote calls InitiateAuth with AuthFlow: 'USER_PASSWORD_AUTH'. Reasonable guess: it is the flow in most Cognito tutorials. But the app client in staging was created by a Terraform module that set explicit_auth_flows = ["ALLOW_USER_SRP_AUTH", "ALLOW_REFRESH_TOKEN_AUTH"], and that client also has a secret. So the call fails twice over: the flow is not enabled for this client, and the request is missing SECRET_HASH.
None of that is visible in your source files. The assistant read your repo, found no answer, and produced the most statistically common Cognito snippet on the internet.
The app client is the config, and it is not in your repo
Cognito's failure modes are almost all per app client settings, not per user pool settings. Four of them break generated code immediately:






