Issue with create mutation concatenating the username twice #3000
Labels
pending-community-response
Issue is pending a response from the author or community.
pending-triage
question
Further information is requested
How did you install the Amplify CLI?
npm
If applicable, what version of Node.js are you using?
No response
Amplify CLI Version
12.13.0
What operating system are you using?
Mac
Did you make any manual changes to the cloud resources managed by Amplify? Please describe the changes made.
No manual changes made
Describe the bug
When creating a new record using Cognito authentication in an Amplify project, the username field is being populated incorrectly. The username value appears duplicated in the format userID::userID instead of the expected single userID format. This is affecting our ability to query and manage records accurately, as the concatenated format does not match our expected schema.
It creates the record, but the response comes null for all the stuff that needs to relate to.
Expected behavior
The username field should only contain the user’s Cognito ID as a single value (e.g., userID), without any additional concatenation.
Reproduction steps
You will get something like "244884a8-20c1-7099-7bab-b1e8c8eef5fb::244884a8-20c1-7099-7bab-b1e8c8eef5fb"
Project Identifier
253d375723e7e6353e94c2aed253815a
Log output
Additional information
The issue is occurring in an environment where we use Amplify's @auth directive with owner authorization. This unintended concatenation might be due to the IAM and Cognito configurations or a possible bug in the auto-population of owner fields by Amplify. Creating a lambda function to create the league through IAM in the backend works but is not a sustainable solution.
Besides, due to these issues, I am getting a lot of errors like below, which I am assuming is due of this issue with the double format username.
Before submitting, please confirm:
The text was updated successfully, but these errors were encountered: